|
|
|
@ -61,8 +61,7 @@ export default function table (state: StateBlock, startLine: number, endLine: nu |
|
|
|
|
|
|
|
if (state.sCount[nextLine] < state.blkIndent) { return false } |
|
|
|
|
|
|
|
// if it's indented more than 3 spaces, it should be a code block
|
|
|
|
if (state.sCount[nextLine] - state.blkIndent >= 4) { return false } |
|
|
|
if (state.isCodeBlock(nextLine)) { return false } |
|
|
|
|
|
|
|
// first character of the second line should be '|', '-', ':',
|
|
|
|
// and no other characters are allowed but spaces;
|
|
|
|
@ -120,7 +119,7 @@ export default function table (state: StateBlock, startLine: number, endLine: nu |
|
|
|
|
|
|
|
lineText = getLine(state, startLine).trim() |
|
|
|
if (lineText.indexOf('|') === -1) { return false } |
|
|
|
if (state.sCount[startLine] - state.blkIndent >= 4) { return false } |
|
|
|
if (state.isCodeBlock(startLine)) { return false } |
|
|
|
columns = escapedSplit(lineText) |
|
|
|
if (columns.length && columns[0] === '') columns.shift() |
|
|
|
if (columns.length && columns[columns.length - 1] === '') columns.pop() |
|
|
|
@ -182,7 +181,7 @@ export default function table (state: StateBlock, startLine: number, endLine: nu |
|
|
|
if (terminate) { break } |
|
|
|
lineText = getLine(state, nextLine).trim() |
|
|
|
if (!lineText) { break } |
|
|
|
if (state.sCount[nextLine] - state.blkIndent >= 4) { break } |
|
|
|
if (state.isCodeBlock(nextLine)) { break } |
|
|
|
columns = escapedSplit(lineText) |
|
|
|
if (columns.length && columns[0] === '') columns.shift() |
|
|
|
if (columns.length && columns[columns.length - 1] === '') columns.pop() |
|
|
|
|