mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-21 15:05:47 +00:00
Org writer: avoid = delimiter for inline code containing =.
Org has no escape mechanism inside verbatim text, so `=code with ==` did not parse as verbatim. Fall back to the equivalent `~...~` delimiter when the content contains `=` (and no `~`). Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
1f43d7fd2e
commit
68bbe9dcae
@@ -548,7 +548,13 @@ inlineToOrg (Cite cs lst) = do
|
||||
_ -> mempty
|
||||
return $ "[cite" <> sty <> ":" <> citeItems <> "]"
|
||||
else inlineListToOrg lst
|
||||
inlineToOrg (Code _ str) = return $ "=" <> literal str <> "="
|
||||
inlineToOrg (Code _ str) = return $
|
||||
-- Org offers no escape mechanism inside verbatim text; if the
|
||||
-- content contains the delimiter, fall back to the other verbatim
|
||||
-- delimiter.
|
||||
if "=" `T.isInfixOf` str && not ("~" `T.isInfixOf` str)
|
||||
then "~" <> literal str <> "~"
|
||||
else "=" <> literal str <> "="
|
||||
inlineToOrg (Str str) = do
|
||||
opts <- gets stOptions
|
||||
let str' = if isEnabled Ext_smart opts || isEnabled Ext_special_strings opts
|
||||
|
||||
+1
-1
@@ -598,7 +598,7 @@ Ellipses...and...and....
|
||||
|
||||
These shouldn't be math:
|
||||
|
||||
- To get the famous equation, write =$e = mc^2$=.
|
||||
- To get the famous equation, write ~$e = mc^2$~.
|
||||
- $22,000 is a /lot/ of money. So is $34,000. (It worked if “lot” is
|
||||
emphasized.)
|
||||
- Shoes ($20) and socks ($5).
|
||||
|
||||
Reference in New Issue
Block a user