A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jrblevin/markdown-mode/commit/58ba6a31843a3dc919aece5f3a152067af3d3ff5 below:

Require a space after hash marks for ATX headers · jrblevin/markdown-mode@58ba6a3 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+12

-17

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+12

-17

lines changed Original file line number Diff line number Diff line change

@@ -1215,7 +1215,7 @@ Group 2 matches only the label, without the surrounding markup.

1215 1215

Group 3 matches the closing square bracket.")

1216 1216 1217 1217

(defconst markdown-regex-header

1218 -

"^\\(?:\\(.+?\\)\n\\(?:\\(=+\\)\\|\\(-+\\)\\)\\|\\(#+\\)[ \t]*\\(.+?\\)[ \t]*\\(#*\\)\\)$"

1218 +

"^\\(?:\\(.+?\\)\n\\(?:\\(=+\\)\\|\\(-+\\)\\)\\|\\(#+\\)[ \t]+\\(.*?\\)[ \t]*\\(#*\\)\\)$"

1219 1219

"Regexp identifying Markdown headings.

1220 1220

Group 1 matches the text of a setext heading.

1221 1221

Group 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.

1225 1225

Group 6 matches the closing hash marks of an atx heading.")

1226 1226 1227 1227

(defconst markdown-regex-header-1-atx

1228 -

"^\\(#\\)[ \t]*\\([^\\.].*?\\)[ \t]*\\(#*\\)$"

1228 +

"^\\(#\\)[ \t]+\\(.*?\\)[ \t]*\\(#*\\)$"

1229 1229

"Regular expression for level 1 atx-style (hash mark) headers.")

1230 1230 1231 1231

(defconst markdown-regex-header-2-atx

1232 -

"^\\(##\\)[ \t]*\\(.+?\\)[ \t]*\\(#*\\)$"

1232 +

"^\\(##\\)[ \t]+\\(.*?\\)[ \t]*\\(#*\\)$"

1233 1233

"Regular expression for level 2 atx-style (hash mark) headers.")

1234 1234 1235 1235

(defconst markdown-regex-header-3-atx

1236 -

"^\\(###\\)[ \t]*\\(.+?\\)[ \t]*\\(#*\\)$"

1236 +

"^\\(###\\)[ \t]+\\(.*?\\)[ \t]*\\(#*\\)$"

1237 1237

"Regular expression for level 3 atx-style (hash mark) headers.")

1238 1238 1239 1239

(defconst markdown-regex-header-4-atx

1240 -

"^\\(####\\)[ \t]*\\(.+?\\)[ \t]*\\(#*\\)$"

1240 +

"^\\(####\\)[ \t]+\\(.*?\\)[ \t]*\\(#*\\)$"

1241 1241

"Regular expression for level 4 atx-style (hash mark) headers.")

1242 1242 1243 1243

(defconst markdown-regex-header-5-atx

1244 -

"^\\(#####\\)[ \t]*\\(.+?\\)[ \t]*\\(#*\\)$"

1244 +

"^\\(#####\\)[ \t]+\\(.*?\\)[ \t]*\\(#*\\)$"

1245 1245

"Regular expression for level 5 atx-style (hash mark) headers.")

1246 1246 1247 1247

(defconst markdown-regex-header-6-atx

1248 -

"^\\(######\\)[ \t]*\\(.+?\\)[ \t]*\\(#*\\)$"

1248 +

"^\\(######\\)[ \t]+\\(.*?\\)[ \t]*\\(#*\\)$"

1249 1249

"Regular expression for level 6 atx-style (hash mark) headers.")

1250 1250 1251 1251

(defconst markdown-regex-header-1-setext

@@ -1261,7 +1261,7 @@ Group 6 matches the closing hash marks of an atx heading.")

1261 1261

"Regular expression for generic setext-style (underline) headers.")

1262 1262 1263 1263

(defconst markdown-regex-header-atx

1264 -

"^\\(#+\\)[ \t]*\\(.*?\\)[ \t]*\\(#*\\)$"

1264 +

"^\\(#+\\)[ \t]+\\(.*?\\)[ \t]*\\(#*\\)$"

1265 1265

"Regular expression for generic atx-style (hash mark) headers.")

1266 1266 1267 1267

(defconst markdown-regex-hr

Original file line number Diff line number Diff line change

@@ -1430,8 +1430,7 @@ the opening bracket of [^2], and then subsequent functions would kill [^2])."

1430 1430

(should (looking-at markdown-regex-header-atx))

1431 1431

(should-not (markdown-incomplete-atx-p)))

1432 1432

(markdown-test-string "###abc###"

1433 -

(should (looking-at markdown-regex-header-atx))

1434 -

(should (markdown-incomplete-atx-p)))

1433 +

(should-not (looking-at markdown-regex-header-atx)))

1435 1434

(markdown-test-string "### ###"

1436 1435

(should (looking-at markdown-regex-header-atx))

1437 1436

(should (markdown-incomplete-atx-p))))

@@ -2205,15 +2204,11 @@ for (var i = 0; i < 10; i++) {

2205 2204

(ert-deftest test-markdown-font-lock/atx-no-spaces ()

2206 2205

"Test font-lock for atx headers with no spaces."

2207 2206

(markdown-test-string "##abc##"

2208 -

(markdown-test-range-has-face 1 2 markdown-header-delimiter-face)

2209 -

(markdown-test-range-has-face 3 5 markdown-header-face-2)

2210 -

(markdown-test-range-has-face 6 7 markdown-header-delimiter-face))

2207 +

(markdown-test-range-has-face 1 7 nil))

2211 2208

(markdown-test-string "##"

2212 -

(markdown-test-range-has-face 1 1 markdown-header-delimiter-face)

2213 -

(markdown-test-range-has-face 2 2 markdown-header-face-1))

2209 +

(markdown-test-range-has-face 1 2 nil))

2214 2210

(markdown-test-string "###"

2215 -

(markdown-test-range-has-face 1 2 markdown-header-delimiter-face)

2216 -

(markdown-test-range-has-face 3 3 markdown-header-face-2)))

2211 +

(markdown-test-range-has-face 1 3 nil)))

2217 2212 2218 2213

(ert-deftest test-markdown-font-lock/setext-1-letter ()

2219 2214

"An edge case for level-one setext headers."

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4