Revert "Allow specifying string value in metadata using !!literal
tag."
This reverts commit 3493d6afaa
.
This might be worth considering in the future, but let's not do
it yet...the additional complexity needs a better justification.
This commit is contained in:
parent
3493d6afaa
commit
0edc084c50
3 changed files with 5 additions and 23 deletions
|
@ -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
|
||||
|
|
|
@ -99,10 +99,8 @@ 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
|
||||
YAML.SUnknown _ t ->
|
||||
case checkBoolean t of
|
||||
Just b -> return $ return $ MetaBool b
|
||||
Nothing -> toMetaValue pBlocks t
|
||||
YAML.SNull -> return $ return $ MetaString ""
|
||||
|
|
|
@ -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"]])]})
|
||||
[]
|
||||
```
|
Loading…
Reference in a new issue