fix(markdown): do not keep increasing backslashes for dollar sign (#5358)
parent
e0362516af
commit
8cedb9d25e
|
@ -46,7 +46,8 @@ function restoreUnescapedCharacter(ast, options) {
|
|||
: Object.assign({}, node, {
|
||||
value:
|
||||
node.value !== "*" &&
|
||||
node.value !== "_" && // handle these two cases in printer
|
||||
node.value !== "_" &&
|
||||
node.value !== "$" && // handle these cases in printer
|
||||
isSingleCharRegex.test(node.value) &&
|
||||
node.position.end.offset - node.position.start.offset !==
|
||||
node.value.length
|
||||
|
|
|
@ -1,5 +1,24 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`dollar-sign.md - markdown-verify 1`] = `
|
||||
$
|
||||
|
||||
\\$
|
||||
|
||||
\\\\$
|
||||
|
||||
\\\\\\$
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
\\$
|
||||
|
||||
\\$
|
||||
|
||||
\\\\\\$
|
||||
|
||||
\\\\\\$
|
||||
|
||||
`;
|
||||
|
||||
exports[`empty-block.md - markdown-verify 1`] = `
|
||||
$$
|
||||
$$
|
||||
|
@ -107,7 +126,7 @@ $$
|
|||
|
||||
---
|
||||
|
||||
\\\\$\\alpha\\$
|
||||
\\$\\alpha\\$
|
||||
|
||||
---
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
$
|
||||
|
||||
\$
|
||||
|
||||
\\$
|
||||
|
||||
\\\$
|
|
@ -3306,7 +3306,7 @@ exports[`example-284.md - markdown-verify 1`] = `
|
|||
exports[`example-285.md - markdown-verify 1`] = `
|
||||
\\!\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\\`\\{\\|\\}\\~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
\\!\\"\\#\\\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\\`\\{\\|\\}\\~
|
||||
\\!\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\\`\\{\\|\\}\\~
|
||||
|
||||
`;
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ markdown\`
|
|||
- \\\\\\\`
|
||||
- \\\\ a
|
||||
- \\\\\\\\
|
||||
- \\\\$
|
||||
- \\$
|
||||
- \\u1234
|
||||
\`;
|
||||
|
||||
|
|
Loading…
Reference in New Issue