From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/108529 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hans van der Meer Newsgroups: gmane.comp.tex.context Subject: Re: catch % in gsub("%", "\\letterpercent") Date: Thu, 27 Aug 2020 17:39:33 +0200 Message-ID: <68AAF0BF-374A-40CE-B628-5B4DB266B647@ziggo.nl> References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Content-Type: multipart/mixed; boundary="===============3491892620387105058==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33667"; mail-complaints-to="usenet@ciao.gmane.io" To: NTG ConTeXt Original-X-From: ntg-context-bounces@ntg.nl Thu Aug 27 17:40: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 1kBK0O-0008dQ-C3 for gctc-ntg-context-518@m.gmane-mx.org; Thu, 27 Aug 2020 17:40:00 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A1CDF1A8815; Thu, 27 Aug 2020 17:39:38 +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 vjahwN8AL1kK; Thu, 27 Aug 2020 17:39:36 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4B4EE1A880B; Thu, 27 Aug 2020 17:39:36 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1C23C1A8808 for ; Thu, 27 Aug 2020 17:39:35 +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 419duoAozARi for ; Thu, 27 Aug 2020 17:39:34 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=212.54.42.167; helo=smtpq4.tb.mail.iss.as9143.net; envelope-from=havdmeer@ziggo.nl; receiver= Original-Received: from smtpq4.tb.mail.iss.as9143.net (smtpq4.tb.mail.iss.as9143.net [212.54.42.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 28D7A1A8805 for ; Thu, 27 Aug 2020 17:39:34 +0200 (CEST) Original-Received: from [212.54.42.137] (helo=smtp6.tb.mail.iss.as9143.net) by smtpq4.tb.mail.iss.as9143.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBJzx-0004gp-VL for ntg-context@ntg.nl; Thu, 27 Aug 2020 17:39:33 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ziggo.nl; s=202002corplgsmtpnl; h=To:Date:Subject:From; bh=t2wxxxKjyeYkD3CnfprIZqYWBR8+uWAZaZFja1r6S04=; b=cdz30vL5ojQCsxfKtf0evIdH6I UKQakrpYlyXUQBS0kO3GLYGg0M8EDHsL5TkUM00znRzzBNVrpSekJvtloRIoFPDx5XtcgJxjE0eFp exrHvxQWt2nPdBuG1cjzIg8vIPzbFPSR7caacEmjqRSarIPnQdSTcWn9Qu4s0G+xFqlgKwY8zdlLK W7KB+iuF/BE4U1tb/BXRM4GZuBQieFZnlUcIXmbpqi+kEGCfb0Kl2uMonv+XO/XJ/37UiZAyU8He5 UAVkw4ngZRmdWcoC0Z9e6i4TmEaFpnSCrTqB3TgFQ7ZXI/BpKiVKOzl//h5Y64CPh2a0QsJj4fksY zR96D8nQ==; Original-Received: from 84-106-134-200.cable.dynamic.v4.ziggo.nl ([84.106.134.200] helo=[192.168.178.15]) by smtp6.tb.mail.iss.as9143.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kBJzx-000DtN-KR for ntg-context@ntg.nl; Thu, 27 Aug 2020 17:39:33 +0200 In-Reply-To: X-Mailer: Apple Mail (2.3608.120.23.2.1) X-SourceIP: 84.106.134.200 X-Authenticated-Sender: havdmeer@ziggo.nl (via SMTP) X-Ziggo-spambar: / X-Ziggo-spamscore: 0.0 X-Ziggo-spamreport: CMAE Analysis: v=2.4 cv=ObYmsjfY c=1 sm=1 tr=0 ts=5f47d3b5 a=wCstmS+ZHA3zSJXjQC+ubA==:17 a=9+rZDBEiDlHhcck0kWbJtElFXBc=:19 a=y4yBn9ojGxQA:10 a=_rPVbZ2XAAAA:8 a=MiNTnEJAAAAA:8 a=YEMqx4UAAAAA:8 a=ACQCx6kCAAAA:8 a=xtERp6CFAAAA:8 a=a3nu-2BBAAAA:8 a=rsLCO41godMZ6gj0YpsA:9 a=CjuIK1q_8ugA:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 a=yGJZtJ-ob6y0HNQXNnkA:9 a=31zzI3nlLNL0STIj:21 a=_W_S_7VecoQA:10 a=jnTqQdiIl9o8571lt6bO:22 a=LmrbSfiT3hecnSZifb5M:22 a=V0662LiR8DSfwiDagK97:22 a=Sab0UneHBzlWrQDlOuxD:22 a=ekCXXmE-vB8RPiJ3MEZb:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=jd6J4Gguk5HxikPWLKER:22 X-Ziggo-Spam-Status: No 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:108529 Archived-At: --===============3491892620387105058== Content-Type: multipart/alternative; boundary="Apple-Mail=_9FC3F9E1-C4ED-4547-9906-CF473CEE9A6F" --Apple-Mail=_9FC3F9E1-C4ED-4547-9906-CF473CEE9A6F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 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 wrote: >=20 > Dear 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") >=20 > How do I need to invoke % to get the character found? >=20 > Many thanks for your help, >=20 > Pablo > -- > http://www.ousia.tk > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > 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 > = __________________________________________________________________________= _________ --Apple-Mail=_9FC3F9E1-C4ED-4547-9906-CF473CEE9A6F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii 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
_______________________________________________________________= ____________________

= --Apple-Mail=_9FC3F9E1-C4ED-4547-9906-CF473CEE9A6F-- --===============3491892620387105058== 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== --===============3491892620387105058==--