Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
hmhealey committed Aug 22, 2024
1 parent 6dfb175 commit f842daf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ var reLineEnding = /\r\n|\n|\r/;

var reTableRow = /^(\|?)(?:(?:\\\||[^|])*\|?)+$/;

var reValidTableDelimiter = /^:?-+:?$/;

var MAX_AUTOCOMPLETED_CELLS = 1000;

// Returns true if string contains only space characters.
Expand Down Expand Up @@ -783,7 +785,7 @@ var blockStarts = [
}

const nextColumn = measureNonspaceColumn(parser.nextLine);
if (nextColumn - parser.column >= CODE_INDENT || parser.column - nextColumn >= CODE_INDENT) {
if (Math.abs(nextColumn - parser.column) >= CODE_INDENT) {
// the delimiter row must be on the same indentation level as the header row
return 0;
}
Expand Down Expand Up @@ -867,7 +869,6 @@ var blockStarts = [
}
];

const reValidTableDelimiter = /^:?-+:?$/;
const parseDelimiterRow = function(row) {
if (row.indexOf("|") === -1) {
return null;
Expand Down
6 changes: 6 additions & 0 deletions test/tables.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,9 @@ Here's a link to [Freedom Planet 2][].

### Invalid table (MM-55972/MM-59809)

This table is invalid because of the space in the middle of the third column
of the second line of the table (`:----------------- --------------:`).

```````````````````````````````` example
| A | B | C | | |
| :--------------------------------: | :----------------------------: | :----------------- --------------: | :-----------: |:-----------: |
Expand All @@ -1219,6 +1222,9 @@ Here's a link to [Freedom Planet 2][].
| | J | K | | |</p>
````````````````````````````````

This table is invalid because the last column of the delimiter row has no
dashes in it (`| |`).

```````````````````````````````` example
| 그룹명 | 자산합계1) | 주력업종1) 및 자산 | 비주력업종1) 및 자산 | 소속 금융회사2) | | | | |
| ---- | ------ | ----------- | ------------ | --------- | ------ | ------ | --- | |
Expand Down

0 comments on commit f842daf

Please sign in to comment.