aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-10-13 10:36:27 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-10-13 10:36:27 -0700
commit6934b921b35950d0a86a966ed3aff7ba1b660ca6 (patch)
treef275b45bda21e252be63abe4a38c6b3d6abf986d /src/Text
parent3720005c53679317aea05f8b9ce53d1451adba69 (diff)
downloadpandoc-6934b921b35950d0a86a966ed3aff7ba1b660ca6.tar.gz
CommonMark writer: omit "fig:" prefix in image titles.
This is used internally to indicate internal figures. See https://groups.google.com/d/msgid/pandoc-discuss/892c5a25-086a-4e19-b4c1-8 975cea8df0f@googlegroups.com?utm_medium=email&utm_source=footer
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/CommonMark.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/CommonMark.hs b/src/Text/Pandoc/Writers/CommonMark.hs
index 446578f42..7ea76a373 100644
--- a/src/Text/Pandoc/Writers/CommonMark.hs
+++ b/src/Text/Pandoc/Writers/CommonMark.hs
@@ -257,6 +257,9 @@ inlineToNodes opts (SmallCaps xs) =
[node (HTML_INLINE (T.pack "</span>")) []]) ++ )
inlineToNodes opts (Link _ ils (url,tit)) =
(node (LINK (T.pack url) (T.pack tit)) (inlinesToNodes opts ils) :)
+-- title beginning with fig: indicates implicit figure
+inlineToNodes opts (Image alt ils (url,'f':'i':'g':':':tit)) =
+ inlineToNodes opts (Image alt ils (url,tit))
inlineToNodes opts (Image _ ils (url,tit)) =
(node (IMAGE (T.pack url) (T.pack tit)) (inlinesToNodes opts ils) :)
inlineToNodes _ (RawInline fmt xs)