diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-02-17 15:58:21 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-02-17 15:58:21 -0800 |
commit | 0edc084c5064694544e32e24006d5b7e90d637a7 (patch) | |
tree | 0d3eb7d231534253ccf0a3bdd1dfc804555b28a5 | |
parent | 3493d6afaa6586c46898cf8bdb0c45bb70d31f28 (diff) | |
download | pandoc-0edc084c5064694544e32e24006d5b7e90d637a7.tar.gz |
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.
-rw-r--r-- | MANUAL.txt | 8 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Metadata.hs | 10 | ||||
-rw-r--r-- | test/command/literal-tag.md | 10 |
3 files changed, 5 insertions, 23 deletions
diff --git a/MANUAL.txt b/MANUAL.txt index c45e8b3d9..891f37cf8 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -3914,8 +3914,7 @@ from the main markdown input document. Metadata will be taken from the fields of the YAML object and added to any existing document metadata. Metadata can contain lists and objects (nested -arbitrarily), but all string scalars will be interpreted as -Markdown, unless marked with the YAML tag `!!literal`. Fields +arbitrarily), but all string scalars will be interpreted as Markdown. Fields with names ending in an underscore will be ignored by pandoc. (They may be given a role by external processors.) Field names must not be interpretable as YAML numbers or boolean values (so, for @@ -3946,11 +3945,6 @@ when the field contains blank lines or block-level formatting: This is the abstract. It consists of two paragraphs. - - # This is a YAML comment; it will be ignored. - # The following field is marked as literal and will be - # interpreted as a literal string rather than Markdown: - catalog_number: !!literal '*abc123<f>*' ... Template variables will be set automatically from the metadata. Thus, for diff --git a/src/Text/Pandoc/Readers/Metadata.hs b/src/Text/Pandoc/Readers/Metadata.hs index d91c4a406..23ceb40f9 100644 --- a/src/Text/Pandoc/Readers/Metadata.hs +++ b/src/Text/Pandoc/Readers/Metadata.hs @@ -99,12 +99,10 @@ yamlToMetaValue pBlocks (YAML.Scalar _ x) = YAML.SBool b -> return $ return $ MetaBool b YAML.SFloat d -> return $ return $ MetaString $ tshow d YAML.SInt i -> return $ return $ MetaString $ tshow i - YAML.SUnknown tag t - | (T.takeWhileEnd (/= ':') <$> YE.tagToText tag) == - Just "literal" -> return $ return $ MetaString t - | otherwise -> case checkBoolean t of - Just b -> return $ return $ MetaBool b - Nothing -> toMetaValue pBlocks t + YAML.SUnknown _ t -> + case checkBoolean t of + Just b -> return $ return $ MetaBool b + Nothing -> toMetaValue pBlocks t YAML.SNull -> return $ return $ MetaString "" yamlToMetaValue pBlocks (YAML.Sequence _ _ xs) = do diff --git a/test/command/literal-tag.md b/test/command/literal-tag.md deleted file mode 100644 index 4bbefab7c..000000000 --- a/test/command/literal-tag.md +++ /dev/null @@ -1,10 +0,0 @@ -``` -% pandoc -t native -s ---- -hi: !!literal '*ook*' -there: '*ook*' -... -^D -Pandoc (Meta {unMeta = fromList [("hi",MetaString "*ook*"),("there",MetaInlines [Emph [Str "ook"]])]}) -[] -``` |