diff --git a/text-crossrefs/README.md b/text-crossrefs/README.md index 3de0350..38ba13a 100644 --- a/text-crossrefs/README.md +++ b/text-crossrefs/README.md @@ -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} diff --git a/text-crossrefs/sample-with-options.md b/text-crossrefs/sample-with-options.md index 2e1642a..27930db 100644 --- a/text-crossrefs/sample-with-options.md +++ b/text-crossrefs/sample-with-options.md @@ -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: '\>' diff --git a/text-crossrefs/text-crossrefs.lua b/text-crossrefs/text-crossrefs.lua index 6b4079b..0507c22 100644 --- a/text-crossrefs/text-crossrefs.lua +++ b/text-crossrefs/text-crossrefs.lua @@ -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