Skip to content

Commit

Permalink
em: Allow escaped underscores in em again
Browse files Browse the repository at this point in the history
This was a regression in 0.3.4

See issue markedjs#641

Test plan:

In node, run

```javascript
var marked = require("./lib/marked.js");
marked.parse("_ABC\\_DEF_")
> '<p><em>ABC_DEF</em></p>\n'
```

Previously, this would give '<p>_ABC_DEF_</p>\n'
  • Loading branch information
ariabuckles committed Feb 1, 2016
1 parent 88ce4df commit fe7eaab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ var inline = {
reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
em: /^\b_((?:[^\\_]|\\[\s\S]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
br: /^ {2,}\n(?!\s*$)/,
del: noop,
Expand Down
Loading

0 comments on commit fe7eaab

Please sign in to comment.