On 8/27/20 5:30 PM, Taco Hoekwater wrote:
[...] Using Lua gsub(), I need to replace something like:
string.gsub([[\xmlraw{#1}{.}]], "%", "\\letterpercent")
Double it: %%
See also https://www.lua.org/manual/5.3/manual.html#6.4.1 , but the mention of %% is a bit hidden.
Many thanks for your replies, Taco and Hans. I’m afraid this doesn’t work (and I need \xmlraw there): \startbuffer[demo] <html> <body> <div id="First"> <p>The <span class="special">% best</span> paragraph.</p> </div> </body> </html> \stopbuffer \startxmlsetups xml:initialize \xmlsetsetup{#1}{html}{xml:gen} \stopxmlsetups \xmlregistersetup{xml:initialize} \startxmlsetups xml:gen \startitemize \xmlfilter{#1}{/**/span[@class='special']/command(xml:special)} \stopitemize \stopxmlsetups \startxmlsetups xml:special \startitem \cldcontext{string.gsub([[\xmlraw{#1}{.}]], "%%", "\\letterpercent")} \stopitem \stopxmlsetups \starttext \xmlprocessbuffer{main}{demo}{} \stoptext What am I missing or doing wrong there? Many thanks for your help, Pablo -- http://www.ousia.tk