From 0b486e867264c2bac02226766055b05d3c51de7e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 9 Sep 2018 13:11:53 -0700 Subject: Org writer: don't escape literal `_`, `^`. Org doesn't recognize these escapes. Closes #4882. --- src/Text/Pandoc/Writers/Org.hs | 2 +- test/writer.org | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index 1dd825b79..12a54fd71 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -109,7 +109,7 @@ escapeString = escapeStringUsing $ , ('\x2013',"--") , ('\x2019',"'") , ('\x2026',"...") - ] ++ backslashEscapes "^_" + ] isRawFormat :: Format -> Bool isRawFormat f = diff --git a/test/writer.org b/test/writer.org index 1ae0ca8f3..32fcfc404 100644 --- a/test/writer.org +++ b/test/writer.org @@ -584,7 +584,7 @@ Superscripts: a^{bc}d a^{/hello/} a^{hello there}. Subscripts: H_{2}O, H_{23}O, H_{many of them}O. These should not be superscripts or subscripts, because of the unescaped -spaces: a\^b c\^d, a~b c~d. +spaces: a^b c^d, a~b c~d. -------------- @@ -674,7 +674,7 @@ Backtick: ` Asterisk: * -Underscore: \_ +Underscore: _ Left brace: { @@ -724,7 +724,7 @@ Just a [[/url/][URL]]. [[/url/][URL and title]] -[[/url/with_underscore][with\_underscore]] +[[/url/with_underscore][with_underscore]] [[mailto:nobody@nowhere.net][Email link]] @@ -816,7 +816,7 @@ Here is a movie [[file:movie.jpg]] icon. :END: Here is a footnote reference,[fn:1] and another.[fn:2] This should /not/ be a -footnote reference, because it contains a space.[\^my note] Here is an inline +footnote reference, because it contains a space.[^my note] Here is an inline note.[fn:3] #+BEGIN_QUOTE -- cgit v1.2.3