In Lua patterns % is a socalled magic character like ^$ etc. These are esacped with a %. Thus %% is what you need in the first string.
dr. Hans van der Meer


On 27 Aug 2020, at 17:11, Pablo Rodriguez <oinos@gmx.es> wrote:

Dear list,

I have and \xmlraw command that gives some text with percent signs.
ConTeXt parses them as comments (so no output).

Using Lua gsub(), I need to replace something like:

 string.gsub([[\xmlraw{#1}{.}]], "%", "\\letterpercent")

How do I need to invoke % to get the character found?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________