@@ -1215,7 +1215,7 @@ Group 2 matches only the label, without the surrounding markup.
12151215Group 3 matches the closing square bracket." )
12161216
12171217(defconst markdown-regex-header
1218- " ^\\ (?:\\ (.+?\\ )\n \\ (?:\\ (=+\\ )\\ |\\ (-+\\ )\\ )\\ |\\ (#+\\ )[ \t ]* \\ (.+ ?\\ )[ \t ]*\\ (#*\\ )\\ )$"
1218+ " ^\\ (?:\\ (.+?\\ )\n \\ (?:\\ (=+\\ )\\ |\\ (-+\\ )\\ )\\ |\\ (#+\\ )[ \t ]+ \\ (.* ?\\ )[ \t ]*\\ (#*\\ )\\ )$"
12191219 " Regexp identifying Markdown headings.
12201220Group 1 matches the text of a setext heading.
12211221Group 2 matches the underline of a level-1 setext heading.
@@ -1225,27 +1225,27 @@ Group 5 matches the text, without surrounding whitespace, of an atx heading.
12251225Group 6 matches the closing hash marks of an atx heading." )
12261226
12271227(defconst markdown-regex-header-1-atx
1228- " ^\\ (#\\ )[ \t ]* \\ ([^ \\ .] .*?\\ )[ \t ]*\\ (#*\\ )$"
1228+ " ^\\ (#\\ )[ \t ]+ \\ (.*?\\ )[ \t ]*\\ (#*\\ )$"
12291229 " Regular expression for level 1 atx-style (hash mark) headers." )
12301230
12311231(defconst markdown-regex-header-2-atx
1232- " ^\\ (##\\ )[ \t ]* \\ (.+ ?\\ )[ \t ]*\\ (#*\\ )$"
1232+ " ^\\ (##\\ )[ \t ]+ \\ (.* ?\\ )[ \t ]*\\ (#*\\ )$"
12331233 " Regular expression for level 2 atx-style (hash mark) headers." )
12341234
12351235(defconst markdown-regex-header-3-atx
1236- " ^\\ (###\\ )[ \t ]* \\ (.+ ?\\ )[ \t ]*\\ (#*\\ )$"
1236+ " ^\\ (###\\ )[ \t ]+ \\ (.* ?\\ )[ \t ]*\\ (#*\\ )$"
12371237 " Regular expression for level 3 atx-style (hash mark) headers." )
12381238
12391239(defconst markdown-regex-header-4-atx
1240- " ^\\ (####\\ )[ \t ]* \\ (.+ ?\\ )[ \t ]*\\ (#*\\ )$"
1240+ " ^\\ (####\\ )[ \t ]+ \\ (.* ?\\ )[ \t ]*\\ (#*\\ )$"
12411241 " Regular expression for level 4 atx-style (hash mark) headers." )
12421242
12431243(defconst markdown-regex-header-5-atx
1244- " ^\\ (#####\\ )[ \t ]* \\ (.+ ?\\ )[ \t ]*\\ (#*\\ )$"
1244+ " ^\\ (#####\\ )[ \t ]+ \\ (.* ?\\ )[ \t ]*\\ (#*\\ )$"
12451245 " Regular expression for level 5 atx-style (hash mark) headers." )
12461246
12471247(defconst markdown-regex-header-6-atx
1248- " ^\\ (######\\ )[ \t ]* \\ (.+ ?\\ )[ \t ]*\\ (#*\\ )$"
1248+ " ^\\ (######\\ )[ \t ]+ \\ (.* ?\\ )[ \t ]*\\ (#*\\ )$"
12491249 " Regular expression for level 6 atx-style (hash mark) headers." )
12501250
12511251(defconst markdown-regex-header-1-setext
@@ -1261,7 +1261,7 @@ Group 6 matches the closing hash marks of an atx heading.")
12611261 " Regular expression for generic setext-style (underline) headers." )
12621262
12631263(defconst markdown-regex-header-atx
1264- " ^\\ (#+\\ )[ \t ]* \\ (.*?\\ )[ \t ]*\\ (#*\\ )$"
1264+ " ^\\ (#+\\ )[ \t ]+ \\ (.*?\\ )[ \t ]*\\ (#*\\ )$"
12651265 " Regular expression for generic atx-style (hash mark) headers." )
12661266
12671267(defconst markdown-regex-hr
0 commit comments