git.iko.soy/typeable/pandoc
on master help sign in
`--self-contained`: don't incorporate elements with `data-external="1"`.

You can leave an external link as it is by adding the attribute data-external="1" to the element. Pandoc will then not try to incorporate its content when `--self-contained` is used. This is similar to a feature already supported by the EPUB writer. Closes #2656.

commit377c27befedd8f9e54975296a71bf4c954399d2d authorJohn MacFarlane <jgm@berkeley.edu> dateSun 26 Feb 2017, 22:48 (10 years ago) parentd7e25d2
2 files changed+10−5
MANUAL.txt+8−5 src/Text/Pandoc/SelfContained.hs+2
MANUAL.txt+8−5
@@ -634,11 +634,14 @@ Options affecting specific writers
634634 stylesheets at absolute URLs will be downloaded; those at relative URLs
635635 will be sought relative to the working directory (if the first source
636636 file is local) or relative to the base URL (if the first source
637− file is remote). Limitation: resources that are loaded dynamically
638− through JavaScript cannot be incorporated; as a result, `--self-contained`
639− does not work with `--mathjax`, and some advanced features (e.g.
640− zoom or speaker notes) may not work in an offline "self-contained"
641− `reveal.js` slide show.
637+ file is remote). Elements with the attribute
638+ `data-external="1"` will be left alone; the documents they
639+ link to will not be incorporated in the document.
640+ Limitation: resources that are loaded dynamically through
641+ JavaScript cannot be incorporated; as a result,
642+ `--self-contained` does not work with `--mathjax`, and some
643+ advanced features (e.g. zoom or speaker notes) may not work
644+ in an offline "self-contained" `reveal.js` slide show.
642645
643646`--html-q-tags`
644647
src/Text/Pandoc/SelfContained.hs+2
@@ -69,6 +69,8 @@ makeDataURI (mime, raw) =
6969
7070convertTags :: PandocMonad m => Maybe String -> [Tag String] -> m [Tag String]
7171convertTags _ [] = return []
72+convertTags sourceURL (t@TagOpen{}:ts)
73+ | fromAttrib "data-external" t == "1" = (t:) <$> convertTags sourceURL ts
7274convertTags sourceURL (t@(TagOpen tagname as):ts)
7375 | tagname `elem`
7476 ["img", "embed", "video", "input", "audio", "source", "track"] = do