From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/108528 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Taco Hoekwater Newsgroups: gmane.comp.tex.context Subject: Re: catch % in gsub("%", "\\letterpercent") Date: Thu, 27 Aug 2020 17:30:32 +0200 Message-ID: <5B0AE000-A4F7-4A39-AB7F-85E71DDB133F@elvenkind.com> References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (1.0) Content-Type: multipart/mixed; boundary="===============1161298716357980420==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33299"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Aug 27 17:31:00 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kBJrg-0008Y8-5u for gctc-ntg-context-518@m.gmane-mx.org; Thu, 27 Aug 2020 17:31:00 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 201B21A87F2; Thu, 27 Aug 2020 17:30:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V2LP0LzmyzIj; Thu, 27 Aug 2020 17:30:38 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 697851A8806; Thu, 27 Aug 2020 17:30:38 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7B5B71A87F2 for ; Thu, 27 Aug 2020 17:30:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V51SbOdiGLZd for ; Thu, 27 Aug 2020 17:30:35 +0200 (CEST) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=5.39.185.224; helo=server5b.aanhet.net; envelope-from=taco@elvenkind.com; receiver= Original-Received: from server5b.aanhet.net (server5b.aanhet.net [5.39.185.224]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id C37BC1A87EE for ; Thu, 27 Aug 2020 17:30:35 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by server5b.aanhet.net (Postfix) with ESMTP id 8AE0D1E7 for ; Thu, 27 Aug 2020 17:30:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at server5.aanhet.net Original-Received: from server5b.aanhet.net ([127.0.0.1]) by localhost (server5b.aanhet.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DBOHYhKq5KTU for ; Thu, 27 Aug 2020 17:30:33 +0200 (CEST) Original-Received: from [10.0.0.21] (boo.demon.nl [83.163.247.99]) by server5b.aanhet.net (Postfix) with ESMTPSA id 32A13177 for ; Thu, 27 Aug 2020 17:30:33 +0200 (CEST) In-Reply-To: X-Mailer: iPad Mail (17G68) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:108528 Archived-At: --===============1161298716357980420== Content-Type: multipart/alternative; boundary=Apple-Mail-D266D083-C4EC-460F-940A-33EF58E330CE Content-Transfer-Encoding: 7bit --Apple-Mail-D266D083-C4EC-460F-940A-33EF58E330CE Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, > On 27 Aug 2020, at 17:11, Pablo Rodriguez wrote: >=20 > =EF=BB=BFDear list, >=20 > I have and \xmlraw command that gives some text with percent signs. > ConTeXt parses them as comments (so no output). >=20 > Using Lua gsub(), I need to replace something like: >=20 > string.gsub([[\xmlraw{#1}{.}]], "%", "\\letterpercent") Double it: %% See also https://www.lua.org/manual/5.3/manual.html#6.4.1 , but the mention o= f %% is a bit hidden. Best wishes, Taco= --Apple-Mail-D266D083-C4EC-460F-940A-33EF58E330CE Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hi,
=
On 27 Aug 2020, at 17:11, Pablo Rodriguez <= oinos@gmx.es> wrote:

=
=EF=BB=BFDear 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:
<= span>

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

Double it: %%

<= /div>
See also https://www.lua.org/manual/5.3/manual.html#6.4.1 , but the= mention of %% is a bit hidden.

Best wishes,
<= div>Taco
= --Apple-Mail-D266D083-C4EC-460F-940A-33EF58E330CE-- --===============1161298716357980420== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============1161298716357980420==--