Skip to content

Commit

Permalink
Markdown reader: Adjust source position in data: URI parser.
Browse files Browse the repository at this point in the history
This fixes an omission in the last commit.
  • Loading branch information
jgm committed Dec 18, 2024
1 parent 3da4d41 commit 5ae45a0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Text/Pandoc/Readers/Markdown.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1867,13 +1867,15 @@ pBase64Data = do
Sources inps <- getInput
case inps of
[] -> mzero
(fp,t):rest -> do
(pos,t):rest -> do
satisfy (A.inClass "A-Za-z0-9+/") -- parse one character or parsec won't know
-- we have consumed input
let (a,r) = T.span (A.inClass "A-Za-z0-9+/") t
let (b, trest) = T.span (=='=') r
setInput $ Sources ((fp,trest):rest)
return (a <> b)
let b64 = a <> b
let pos' = incSourceColumn pos (T.length b64)
setInput $ Sources ((pos',trest):rest)
return b64

linkTitle :: PandocMonad m => MarkdownParser m Text
linkTitle = quotedTitle '"' <|> quotedTitle '\''
Expand Down

0 comments on commit 5ae45a0

Please sign in to comment.