aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2024-07-27 20:08:55 +0300
committerJohn MacFarlane <[email protected]>2024-07-27 21:01:00 -0700
commit9cdc99cb7d748b5edf8f0aeb091bebc66ac77ebe (patch)
tree11f4c78efd365187b77d498a637c6f19b494f4f3 /src/Text
parent2f36df65e6b8aa9b12551b3773d55a855c24a03d (diff)
RTF reader: handle `\*\shppict` without dropping image.
Closes #10025.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/RTF.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/RTF.hs b/src/Text/Pandoc/Readers/RTF.hs
index 8bf653fc1..4426ab45d 100644
--- a/src/Text/Pandoc/Readers/RTF.hs
+++ b/src/Text/Pandoc/Readers/RTF.hs
@@ -428,10 +428,12 @@ processTok bs (Tok pos tok') = do
UnformattedText{} -> return ()
_ -> updateState $ \s -> s{ sEatChars = 0 }
case tok' of
- Grouped (Tok _ (ControlSymbol '*') : toks) ->
- bs <$ (do oldTextContent <- sTextContent <$> getState
- processTok mempty (Tok pos (Grouped toks))
- updateState $ \st -> st{ sTextContent = oldTextContent })
+ Grouped (Tok _ (ControlSymbol '*') : toks@(firsttok:_)) ->
+ case firsttok of
+ Tok _ (ControlWord "shppict" _) -> inGroup (foldM processTok bs toks)
+ _ -> bs <$ (do oldTextContent <- sTextContent <$> getState
+ processTok mempty (Tok pos (Grouped toks))
+ updateState $ \st -> st{ sTextContent = oldTextContent })
Grouped (Tok _ (ControlWord "fonttbl" _) : toks) -> inGroup $ do
updateState $ \s -> s{ sFontTable = processFontTable toks }
pure bs