Skip to content

Commit

Permalink
Setext headers may not begin with hyphens
Browse files Browse the repository at this point in the history
Prohibit this so that there is no ambiguity between setext headings
and in-progress lists (e.g., when the point is at X below)

- item 1
-X

Closes GH-139.
  • Loading branch information
jrblevin committed May 9, 2016
1 parent e19f419 commit 0172b7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ Group 2 matches only the label, without the surrounding markup.
Group 3 matches the closing square bracket.")

(defconst markdown-regex-header
"^\\(?:\\(.+?\\)\n\\(?:\\(=+\\)\\|\\(-+\\)\\)\\|\\(#+\\)[ \t]+\\(.*?\\)[ \t]*\\(#*\\)\\)$"
"^\\(?:\\([^\r\n-].*\\)\n\\(?:\\(=+\\)\\|\\(-+\\)\\)\\|\\(#+\\)[ \t]+\\(.*?\\)[ \t]*\\(#*\\)\\)$"
"Regexp identifying Markdown headings.
Group 1 matches the text of a setext heading.
Group 2 matches the underline of a level-1 setext heading.
Expand Down Expand Up @@ -1319,7 +1319,7 @@ Group 6 matches the closing hash marks of an atx heading.")
"Regular expression for level 2 setext-style (underline) headers.")

(defconst markdown-regex-header-setext
"^\\(.+\\)\n\\(\\(?:=\\|-\\)+\\)$"
"^\\([^\r\n-].*\\)\n\\(=+\\|-+\\)$"
"Regular expression for generic setext-style (underline) headers.")

(defconst markdown-regex-header-atx
Expand Down

0 comments on commit 0172b7d

Please sign in to comment.