Skip to content

Commit

Permalink
don't escpae [] in gfm (allow for MediaWiki extensions)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Mar 15, 2020
1 parent fb12680 commit 5bc2be7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gwt/panmirror/src/editor/src/pandoc/from_prosemirror.ts
Expand Up @@ -197,7 +197,12 @@ class PandocWriter implements PandocOutput {
if (this.options.writeSpaces && ch === ' ') {
flushTextRun();
this.writeToken(PandocTokenType.Space);
} else if (this.format.extensions.tex_math_single_backslash && ['(', ')', '[', ']'].includes(ch)) {
} else if (
// disable [] escaping for gfm (allows for MediaWiki extensions in GitHub wikis)
(this.format.baseName === 'gfm' && ['[', ']'].includes(ch)) ||
// disable []() escaping in tex_math_single_backslash
(this.format.extensions.tex_math_single_backslash && ['(', ')', '[', ']'].includes(ch))
) {
flushTextRun();
this.writeRawMarkdown(ch);
} else {
Expand Down

0 comments on commit 5bc2be7

Please sign in to comment.