diff options
author | Philipp Gesang <megas.kapaneus@gmail.com> | 2011-08-28 14:30:54 +0200 |
---|---|---|
committer | Philipp Gesang <megas.kapaneus@gmail.com> | 2011-08-28 14:30:54 +0200 |
commit | 001738e26e1b841a4042b3597ba28d9c3d04aef6 (patch) | |
tree | 6e1898eed40ac96a7677206109e6395ddd98f619 /mod/tex/context/third/rst/rst_setups.lua | |
parent | 258db63993a69f76301faefa7e7a5727f23d2614 (diff) | |
download | context-rst-001738e26e1b841a4042b3597ba28d9c3d04aef6.tar.gz |
fixed solitary substitution bug (reported by Philipp A.)
Diffstat (limited to 'mod/tex/context/third/rst/rst_setups.lua')
-rw-r--r-- | mod/tex/context/third/rst/rst_setups.lua | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/mod/tex/context/third/rst/rst_setups.lua b/mod/tex/context/third/rst/rst_setups.lua index 7502621..08f21c5 100644 --- a/mod/tex/context/third/rst/rst_setups.lua +++ b/mod/tex/context/third/rst/rst_setups.lua @@ -8,12 +8,13 @@ -------------------------------------------------------------------------------- -- ---local rst_directives = context and thirddata.rst_directives or require "rst_directives" local optional_setups = { } thirddata.rst_setups = optional_setups local rst_directives = thirddata.rst_directives local rst_context = thirddata.rst - --rst_directives = require "rst_directives" + +local fmt = string.format +local stringstrip = string.strip function optional_setups.footnote_symbol () local setup = [[ @@ -42,13 +43,13 @@ function optional_setups.footnotes () ]] for nf, note in next, tf.numbered do - fn = fn .. string.format(buffer, "Autonumbered footnote", "__footnote_number_"..nf, note) + fn = fn .. fmt(buffer, "Autonumbered footnote", "__footnote_number_"..nf, note) end for nf, note in next, tf.autolabel do - fn = fn .. string.format(buffer, "Labeled footnote", "__footnote_label_"..nf, note) + fn = fn .. fmt(buffer, "Labeled footnote", "__footnote_label_"..nf, note) end for nf, note in next, tf.symbol do - fn = fn .. string.format(buffer, "Symbol footnote", "__footnote_symbol_"..nf, note) + fn = fn .. fmt(buffer, "Symbol footnote", "__footnote_symbol_"..nf, note) end return fn end @@ -95,7 +96,7 @@ function optional_setups.references () if arefs[ref_text] then ref_text = rst_context.anonymous_links[tonumber(arefs[ref_text])] end - references[#references+1] = string.format([[ + references[#references+1] = fmt([[ \useURL[__target_%s] [%s] [] [%s] ]], rst_context.whitespace_to_underscore(ref), urlescape(target), ref_text) end end @@ -125,7 +126,7 @@ function optional_setups.substitutions () local rs = rst_context.substitutions for name, content in next, rs do local directive, data = content.directive, content.data - name, data = name:gsub("%s", ""), string.strip(data) + name, data = name:gsub("%s", ""), stringstrip(data) if directives[directive] then substitutions = substitutions .. directives[directive](name, data) else |