summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2022-07-07 22:56:02 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2022-07-07 22:56:29 +0200
commit56051c8ac36ec02ce17e17faa79d250f8ee7f5ff (patch)
tree0214f4046ec6964c058f74776f4e586573d489ce
parent7fdc01ac0d91a037b48847939b762654174b4125 (diff)
RTF reader: support `\nosupersub`.
Closes #8170.
-rw-r--r--src/Text/Pandoc/Readers/RTF.hs3
-rw-r--r--test/command/8170.md15
2 files changed, 18 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/RTF.hs b/src/Text/Pandoc/Readers/RTF.hs
index e781a9a09..c29a33b32 100644
--- a/src/Text/Pandoc/Readers/RTF.hs
+++ b/src/Text/Pandoc/Readers/RTF.hs
@@ -590,6 +590,9 @@ processTok bs (Tok pos tok') = do
modifyGroup (\g -> g{ gSub = boolParam mbp })
ControlWord "super" mbp -> bs <$
modifyGroup (\g -> g{ gSuper = boolParam mbp })
+ ControlWord "nosupersub" mbp -> bs <$
+ modifyGroup (\g -> g{ gSuper = not $ boolParam mbp
+ , gSub = not $ boolParam mbp })
ControlWord "up" mbp -> bs <$
modifyGroup (\g -> g{ gSuper = boolParam mbp })
ControlWord "strike" mbp -> bs <$
diff --git a/test/command/8170.md b/test/command/8170.md
new file mode 100644
index 000000000..02485ac94
--- /dev/null
+++ b/test/command/8170.md
@@ -0,0 +1,15 @@
+```
+% pandoc -f rtf -t html
+{\rtf1\ansi\ansicpg1252\cocoartf2638
+\cocoascreenfonts1\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\froman\fcharset0 Times-Roman;}
+{\colortbl;\red255\green255\blue255;}
+{\*\expandedcolortbl;;}
+\margl1440\margr1440\vieww16800\viewh17280\viewkind0
+\pard\tx1080\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li180\fi440\sa120\pardirnatural\partightenfactor0
+
+\f0\fs34 \cf0 In 5
+\fs20 \super th
+\fs34 \nosupersub grade I found a bug.}
+^D
+<p>In 5<sup>th</sup> grade I found a bug.</p>
+```