On 8/20/20 11:27 AM, Hans Hagen wrote:
On 8/19/2020 6:10 PM, Pablo Rodriguez wrote:
[...] Is there any way to remove " of " and " of the " in the filtered content (xml:special)?
Sorry, Lua code is crap for sure. [...] \startxmlsetups xml:initialize \xmlsetsetup{#1}{html}{xml:gen} \xmlsetsetup{#1}{span[@class='special']}{xml:span:special} \stopxmlsetups [...] \startxmlsetups xml:span:special (\cldcontext{(string.gsub([[\xmlraw{#1}{.}]]," of the ", ""))}) \stopxmlsetups
Many thanks for your reply, Hans. I now see that \xmlraw is the way to go. I have two questions in word replacement and Lua (maybe there is some lpeg magic that could be used). This time, I have to remove two words, such as in: string.gsub([[\xmlraw{#1}{.}]]," del ", " "):gsub(" de la ", " ")} But they could be more (and replacements might be added to that list). Is there a more elegant way than appending :gsub()? Is there also a proper way for word scanning? A "word" can be "Word ", " word " " word." " word?" (and so on). I would like to avoid having to code all combinations (of course, if this were already available). Many thanks for your help, Pablo -- http://www.ousia.tk