Skip to content

Commit

Permalink
fix(horizontal rule): revert backwards incompatibility change
Browse files Browse the repository at this point in the history
Horizontal rule syntax allows up to 3 spaces preceding dashes or
asterisks. Commit da8fb53 wrongfully removed that. This commit
puts that back.

Closes #317
  • Loading branch information
tivie committed Dec 20, 2016
1 parent cf2a907 commit 113f5f6
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
6 changes: 3 additions & 3 deletions dist/showdown.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/showdown.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/showdown.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/showdown.min.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/subParsers/blockGamut.js
Expand Up @@ -14,9 +14,9 @@ showdown.subParser('blockGamut', function (text, options, globals) {

// Do Horizontal Rules:
var key = showdown.subParser('hashBlock')('<hr />', options, globals);
text = text.replace(/^( ?-){3,}[ \t]*$/gm, key);
text = text.replace(/^( ?\*){3,}[ \t]*$/gm, key);
text = text.replace(/^( ?_){3,}[ \t]*$/gm, key);
text = text.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key);
text = text.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key);
text = text.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key);

text = showdown.subParser('lists')(text, options, globals);
text = showdown.subParser('codeBlocks')(text, options, globals);
Expand Down
2 changes: 2 additions & 0 deletions test/issues/#317.spaces-before-hr.html
@@ -0,0 +1,2 @@
<hr />
<hr />
3 changes: 3 additions & 0 deletions test/issues/#317.spaces-before-hr.md
@@ -0,0 +1,3 @@
---

- - -

0 comments on commit 113f5f6

Please sign in to comment.