refactor.
This commit is contained in:
parent
d8af0af8e8
commit
29eacfdee3
@ -159,13 +159,15 @@ block.token = function(src, tokens, top) {
|
||||
};
|
||||
|
||||
for (i = 0; i < item.align.length; i++) {
|
||||
item.align[i] = /^ *-+: *$/.test(item.align[i])
|
||||
? 'right'
|
||||
: /^ *:-+: *$/.test(item.align[i])
|
||||
? 'center'
|
||||
: /^ *:-+ *$/.test(item.align[i])
|
||||
? 'left'
|
||||
: false;
|
||||
if (/^ *-+: *$/.test(item.align[i])) {
|
||||
item.align[i] = 'right';
|
||||
} else if (/^ *:-+: *$/.test(item.align[i])) {
|
||||
item.align[i] = 'center';
|
||||
} else if (/^ *:-+ *$/.test(item.align[i])) {
|
||||
item.align[i] = 'left';
|
||||
} else {
|
||||
item.align[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < item.cells.length; i++) {
|
||||
@ -317,13 +319,15 @@ block.token = function(src, tokens, top) {
|
||||
};
|
||||
|
||||
for (i = 0; i < item.align.length; i++) {
|
||||
item.align[i] = /^ *-+: *$/.test(item.align[i])
|
||||
? 'right'
|
||||
: /^ *:-+: *$/.test(item.align[i])
|
||||
? 'center'
|
||||
: /^ *:-+ *$/.test(item.align[i])
|
||||
? 'left'
|
||||
: false;
|
||||
if (/^ *-+: *$/.test(item.align[i])) {
|
||||
item.align[i] = 'right';
|
||||
} else if (/^ *:-+: *$/.test(item.align[i])) {
|
||||
item.align[i] = 'center';
|
||||
} else if (/^ *:-+ *$/.test(item.align[i])) {
|
||||
item.align[i] = 'left';
|
||||
} else {
|
||||
item.align[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < item.cells.length; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user