LaTeX reader: Properly handle \^
followed by group closing.
Closes #7615.
This commit is contained in:
parent
90106c300a
commit
c72277e986
2 changed files with 9 additions and 3 deletions
|
@ -35,7 +35,7 @@ import Text.Pandoc.Readers.LaTeX.Parsing
|
|||
import Text.Pandoc.Extensions (extensionEnabled, Extension(..))
|
||||
import Text.Pandoc.Parsing (getOption, updateState, getState, notFollowedBy,
|
||||
manyTill, getInput, setInput, incSourceColumn,
|
||||
option, many1, try)
|
||||
option, many1)
|
||||
import Data.Char (isDigit)
|
||||
import Text.Pandoc.Highlighting (fromListingsLanguage,)
|
||||
import Data.Maybe (maybeToList, fromMaybe)
|
||||
|
@ -160,8 +160,8 @@ romanNumeralArg = spaces *> (parser <|> inBraces)
|
|||
|
||||
accentWith :: PandocMonad m
|
||||
=> LP m Inlines -> Char -> Maybe Char -> LP m Inlines
|
||||
accentWith tok combiningAccent fallBack = try $ do
|
||||
ils <- tok
|
||||
accentWith tok combiningAccent fallBack = do
|
||||
ils <- option mempty tok
|
||||
case toList ils of
|
||||
(Str (T.uncons -> Just (x, xs)) : ys) -> return $ fromList $
|
||||
-- try to normalize to the combined character:
|
||||
|
|
6
test/command/7615.md
Normal file
6
test/command/7615.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
```
|
||||
% pandoc -f latex -t native
|
||||
\texttt{\^}
|
||||
^D
|
||||
[ Para [ Code ( "" , [] , [] ) "^" ] ]
|
||||
```
|
Loading…
Add table
Reference in a new issue