Fwd: Re: Replacing %20 with spaces in xml attributes
-------- Forwarded Message --------
Subject: Re: [NTG-context] Re: Replacing %20 with spaces in xml attributes
Date: Fri, 21 Jul 2023 17:50:04 +0200
From: Hans Hagen
Thanks, but I'm still getting the same error. I'm thinking that it has something to do with the percent characters...
This here works just fine:
\startluacode function test(s) result = string.gsub(s, 'x20', 'MATCH') context(result) end \stopluacode
\define[1]\test{\ctxlua{test("#1")}}
\starttext \test{asdfx20} % -> asdfMATCH \stoptext
But this here won't:
\startluacode function test(s) result = string.gsub(s, '%%20', 'MATCH') context(result) end \stopluacode
\define[1]\test{\ctxlua{test("#1")}}
\starttext \test{asdf%20} % -> does not work \stoptext
Any ideas? \startluacode function xml.finalizers.tex.url(e,a) local u = #e > 0 and e[1].at[a] local s = u and lpeg.match(lpeg.patterns.urlunescaper,u) context(s) end \stopluacode
\startxmlsetups xml:something \xmlatt{#1}{xlink:href}\par \xmlfilter{#1}{./url('xlink:href')} \stopxmlsetups i'll add this Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (1)
-
Hans Hagen