git.iko.soy/typeable/pandoc
on master help sign in
Revert "Allow specifying string value in metadata using `!!literal` tag."

This reverts commit 3493d6afaa6586c46898cf8bdb0c45bb70d31f28. This might be worth considering in the future, but let's not do it yet...the additional complexity needs a better justification.

commit0edc084c5064694544e32e24006d5b7e90d637a7 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 17 Feb 2020, 15:58 (7 years ago) parent3493d6a
3 files changed+5−23
MANUAL.txt+1−7 src/Text/Pandoc/Readers/Metadata.hs+4−6 test/command/literal-tag.md−10
MANUAL.txt+1−7
@@ -3914,8 +3914,7 @@ from the main markdown input document.
39143914
39153915Metadata will be taken from the fields of the YAML object and added to any
39163916existing document metadata. Metadata can contain lists and objects (nested
3917−arbitrarily), but all string scalars will be interpreted as
3918−Markdown, unless marked with the YAML tag `!!literal`. Fields
3917+arbitrarily), but all string scalars will be interpreted as Markdown. Fields
39193918with names ending in an underscore will be ignored by pandoc. (They may be
39203919given a role by external processors.) Field names must not be
39213920interpretable as YAML numbers or boolean values (so, for
@@ -3946,11 +3945,6 @@ when the field contains blank lines or block-level formatting:
39463945 This is the abstract.
39473946
39483947 It consists of two paragraphs.
3949−
3950− # This is a YAML comment; it will be ignored.
3951− # The following field is marked as literal and will be
3952− # interpreted as a literal string rather than Markdown:
3953− catalog_number: !!literal '*abc123<f>*'
39543948 ...
39553949
39563950Template variables will be set automatically from the metadata. Thus, for
src/Text/Pandoc/Readers/Metadata.hs+4−6
@@ -99,12 +99,10 @@ yamlToMetaValue pBlocks (YAML.Scalar _ x) =
9999 YAML.SBool b -> return $ return $ MetaBool b
100100 YAML.SFloat d -> return $ return $ MetaString $ tshow d
101101 YAML.SInt i -> return $ return $ MetaString $ tshow i
102− YAML.SUnknown tag t
103− | (T.takeWhileEnd (/= ':') <$> YE.tagToText tag) ==
104− Just "literal" -> return $ return $ MetaString t
105− | otherwise -> case checkBoolean t of
106− Just b -> return $ return $ MetaBool b
107− Nothing -> toMetaValue pBlocks t
102+ YAML.SUnknown _ t ->
103+ case checkBoolean t of
104+ Just b -> return $ return $ MetaBool b
105+ Nothing -> toMetaValue pBlocks t
108106 YAML.SNull -> return $ return $ MetaString ""
109107
110108yamlToMetaValue pBlocks (YAML.Sequence _ _ xs) = do
test/command/literal-tag.mddeleted−10
@@ -1,10 +0,0 @@
1−```
2−% pandoc -t native -s
3−---
4−hi: !!literal '*ook*'
5−there: '*ook*'
6−...
7−^D
8−Pandoc (Meta {unMeta = fromList [("hi",MetaString "*ook*"),("there",MetaInlines [Emph [Str "ook"]])]})
9−[]
10−```