Skip to content

Commit

Permalink
Fix breaks (markedjs#1507)
Browse files Browse the repository at this point in the history
Fix breaks
  • Loading branch information
UziTech committed Jun 29, 2019
2 parents 4f40c22 + 322e68a commit 234c919
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/marked.js
Expand Up @@ -634,7 +634,10 @@ inline.gfm.url = edit(inline.gfm.url, 'i')

inline.breaks = merge({}, inline.gfm, {
br: edit(inline.br).replace('{2,}', '*').getRegex(),
text: edit(inline.gfm.text).replace(/\{2,\}/g, '*').getRegex()
text: edit(inline.gfm.text)
.replace('\\b_', '\\b_| {2,}\\n')
.replace(/\{2,\}/g, '*')
.getRegex()
});

/**
Expand Down
1 change: 1 addition & 0 deletions test/specs/new/breaks.html
@@ -0,0 +1 @@
<p>A<br>B</p>
6 changes: 6 additions & 0 deletions test/specs/new/breaks.md
@@ -0,0 +1,6 @@
---
breaks: true
gfm: true
---
A
B

0 comments on commit 234c919

Please sign in to comment.