Skip to content

Commit

Permalink
remark-stringify: fix unneeded escape of exclamation mark
Browse files Browse the repository at this point in the history
Closes GH-427.
Closes GH-429.

Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
Reviewed-by: Merlijn Vos <merlijn@soverin.net>
Reviewed-by: Titus Wormer <tituswormer@gmail.com>
  • Loading branch information
arobase-che authored and wooorm committed Jul 23, 2019
1 parent d6c6cd4 commit c036464
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions packages/remark-stringify/lib/escape.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ function factory(options) {
character === backslash ||
character === graveAccent ||
character === asterisk ||
(character === exclamationMark &&
value.charAt(position + 1) === leftSquareBracket) ||
character === leftSquareBracket ||
character === lessThan ||
(character === ampersand && prefix(value.slice(position)) > 0) ||
Expand Down
2 changes: 1 addition & 1 deletion packages/remark-stringify/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ test('stringify escapes', function(t) {

t.equal(toString(u('image', {alt: 'a]b'})), '![a\\]b](<>)', '`]` (in images)')

t.equal(toString('![a'), '\\!\\[a', '`!` before `[`')
t.equal(toString('![a'), '!\\[a', '`!` before `[`')

t.equal(toString('a~b'), 'a~b', '`~`')
t.equal(toString('a~~b'), 'a\\~~b', '`~~`')
Expand Down

0 comments on commit c036464

Please sign in to comment.