Fix handling of mis-identified setext header.

This commit is contained in:
David Anson 2016-01-07 21:22:15 -08:00
parent 26ab9a5596
commit f91e3dafb6
2 changed files with 8 additions and 1 deletions

View file

@ -428,7 +428,7 @@ module.exports = [
} else if (token.type === "inline") { } else if (token.type === "inline") {
token.content.split(shared.newLineRe) token.content.split(shared.newLineRe)
.forEach(function forLine(line, offset) { .forEach(function forLine(line, offset) {
if (/^(-+|=+)\s*$/.test(line)) { if (token.map && /^(-+|=+)\s*$/.test(line)) {
var seTextLineNumber = token.map[0] + offset; var seTextLineNumber = token.map[0] + offset;
if (seTextLineNumber > 0) { if (seTextLineNumber > 0) {
errors.push(seTextLineNumber); errors.push(seTextLineNumber);

7
test/simple-table.md Normal file
View file

@ -0,0 +1,7 @@
# Header
| Head |
| ---- |
| Cell |
| ==== |
| Foot |