git.iko.soy/typeable/pandoc
on master help sign in
Org reader: read HTML_head as header-includes

HTML-specific head content can be defined in `#+HTML_head` lines. They are parsed as format-specific inlines to ensure that they will only show up in HTML output.

commit28d17ea70fee316576cf28525e9b5ad15c62cf9d authorAlbert Krewinkel <albert@zeitkraut.de> dateMon 29 Aug 2016, 14:10 (10 years ago) parentd164ead
2 files changed+9
src/Text/Pandoc/Readers/Org/Meta.hs+2 tests/Tests/Readers/Org.hs+7
src/Text/Pandoc/Readers/Org/Meta.hs+2
@@ -82,6 +82,8 @@ metaValue key =
8282 -- pandoc does not.
8383 "latex_class_options" -> ("classoption",) <$>
8484 metaModifiedString (filter (`notElem` "[]"))
85+ "html_head" -> (inclKey,) <$>
86+ accumulatingList inclKey (metaExportSnippet "html")
8587 _ -> (key,) <$> metaString
8688
8789metaInlines :: OrgParser (F MetaValue)
tests/Tests/Readers/Org.hs+7
@@ -513,6 +513,13 @@ tests =
513513 let meta = setMeta "classoption" (MetaString "a4paper") nullMeta
514514 in Pandoc meta mempty
515515
516+ , "LaTeX_class_options is translated to classoption" =:
517+ "#+html_head: <meta/>" =?>
518+ let html = rawInline "html" "<meta/>"
519+ inclList = MetaList [MetaInlines (toList html)]
520+ meta = setMeta "header-includes" inclList nullMeta
521+ in Pandoc meta mempty
522+
516523 , "later meta definitions take precedence" =:
517524 unlines [ "#+AUTHOR: this will not be used"
518525 , "#+author: Max"