text-crossrefs: authorize spaces in metadata values
This commit is contained in:
@ -263,10 +263,10 @@ and should be collapsed by the macro when it is desirable:
|
||||
# Customization
|
||||
|
||||
Most of the customization variables expect a string.
|
||||
In this case, they must not contain Markdown markup
|
||||
and all breakable spaces must be replaced with the HTML entity ` `:
|
||||
otherwise, only the first word is taken into account and leading and trailing spaces are ignored.
|
||||
See `sample-with-options.md` for examples.
|
||||
In this case, all Markdown markup will be ignored.
|
||||
To prevent leading and trailing spaces to be stripped by Pandoc,
|
||||
they must be replaced with HTML entities (` `):
|
||||
see `sample-with-options.md` for examples.
|
||||
|
||||
## Common options {#common-opts}
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ tcrf-pagenote-first-type: note
|
||||
tcrf-range-separator: '-'
|
||||
tcrf-references-enum-separator: ';'
|
||||
tcrf-multiple-delimiter: '; '
|
||||
tcrf-multiple-before-last: '; and '
|
||||
tcrf-multiple-before-last: '; and '
|
||||
tcrf-additional-types:
|
||||
- line
|
||||
tcrf-range-delim-crossrefenum: '\>'
|
||||
|
||||
@ -136,18 +136,17 @@ local function set_configuration_item_from_metadata(item, metamap)
|
||||
local metakey = 'tcrf-' .. string.gsub(item, '_', '-')
|
||||
if metamap[metakey] then
|
||||
if IS_CONFIG_ARRAY[item] then
|
||||
-- The metadata values is a list of MetaInlines,
|
||||
-- each of them contains a single Str.
|
||||
-- The metadata values is a list of MetaInlines.
|
||||
for _, value_metalist in ipairs(metamap[metakey]) do
|
||||
table.insert(config[item], value_metalist[1].text)
|
||||
table.insert(config[item], stringify(value_metalist))
|
||||
end
|
||||
else
|
||||
local value = metamap[metakey]
|
||||
if type(value) == 'boolean' then
|
||||
config[item] = value
|
||||
else
|
||||
-- The metadata value is a single Str in a MetaInlines.
|
||||
config[item] = value[1].text
|
||||
-- The metadata value is a MetaInlines.
|
||||
config[item] = stringify(value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user