aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/Textile.hs4
-rw-r--r--tests/writer.textile4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/Textile.hs b/src/Text/Pandoc/Writers/Textile.hs
index 05acb5e8b..cb8f20a0a 100644
--- a/src/Text/Pandoc/Writers/Textile.hs
+++ b/src/Text/Pandoc/Writers/Textile.hs
@@ -344,13 +344,13 @@ inlineToTextile opts (Superscript lst) = do
contents <- inlineListToTextile opts lst
return $ if '^' `elem` contents
then "<sup>" ++ contents ++ "</sup>"
- else "^" ++ contents ++ "^"
+ else "[^" ++ contents ++ "^]"
inlineToTextile opts (Subscript lst) = do
contents <- inlineListToTextile opts lst
return $ if '~' `elem` contents
then "<sub>" ++ contents ++ "</sub>"
- else "~" ++ contents ++ "~"
+ else "[~" ++ contents ++ "~]"
inlineToTextile opts (SmallCaps lst) = inlineListToTextile opts lst
diff --git a/tests/writer.textile b/tests/writer.textile
index 7fcda539d..b3e2e545b 100644
--- a/tests/writer.textile
+++ b/tests/writer.textile
@@ -450,9 +450,9 @@ This is code: @&gt;@, @$@, @\@, @\$@, @&lt;html&gt;@.
-This is _strikeout_.-
-Superscripts: a^bc^d a^_hello_^ a^hello there^.
+Superscripts: a[^bc^]d a[^_hello_^] a[^hello there^].
-Subscripts: H~2~O, H~23~O, H~many of them~O.
+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.