From 6934b921b35950d0a86a966ed3aff7ba1b660ca6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 13 Oct 2017 10:36:27 -0700 Subject: 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 --- src/Text/Pandoc/Writers/CommonMark.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Text/Pandoc') 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 "")) []]) ++ ) 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) -- cgit v1.2.3