Re: [NTG-context] issue with character and \xmlprettyprinttext
On 02/20/2018 06:10 PM, Hans Hagen wrote: > [...] > local name = P("\\") * (patterns.utf8char + S("@!?_"))^1 After checking other code samples, I realized that the approach had to be different: local name = P("\\") * (patterns.letter + S("@!?_") + patterns.utf8two + patterns.utf8three + patterns.utf8four)^1 Sorry for taking too much to realize this, 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 ___
Re: [NTG-context] issue with character and \xmlprettyprinttext
On 02/20/2018 06:10 PM, Hans Hagen wrote: > On 2/20/2018 5:18 PM, Pablo Rodriguez wrote: >> [...] >> I’m afraid it might be a bug. > > local name = P("\\") * (patterns.utf8char + S("@!?_"))^1 Hans, I’m afraid that my previous reply was too fast. Just after testing it worked, I saw it broke comments themselves. Something like that would be needed: local name = P("\\") * (patterns.utf8character - S(" \t\f\v\n\r.,;'\"=+-"))^1 I hope it might 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 ___
Re: [NTG-context] issue with character and \xmlprettyprinttext
On 02/20/2018 06:10 PM, Hans Hagen wrote: > On 2/20/2018 5:18 PM, Pablo Rodriguez wrote: >> [...] >> I’m afraid it might be a bug. > > local name = P("\\") * (patterns.utf8char + S("@!?_"))^1 Many thanks for your fast fix, Hans. 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 ___
Re: [NTG-context] issue with character and \xmlprettyprinttext
On 2/20/2018 5:18 PM, Pablo Rodriguez wrote: On 02/20/2018 09:32 AM, Hans Hagen wrote: On 2/19/2018 10:14 PM, Pablo Rodriguez wrote: [...] For some strange reason, "\␣" is problematic only when \xmlprettyprinttext (or \xmlinlineprettyprinttext) is set to tex. Is this a bug or am I missing something? are you sure that the font you use has the character Many thanks for your reply, Hans. The chars are there: \setuptype[option=tex] \starttext \startTEXpage[offset=1em] \type{\ ␣ \ á \ ñ} % \type{\␣ \á \ñ} {\ttbf \letterbackslash ␣ \letterbackslash á \letterbackslash ñ} \stopTEXpage \stoptext The problem is that the \type command and the typing start-stop break when the backslash is followed by a non ASCII character. The commented line shows the issue. I’m afraid it might be a bug. local name = P("\\") * (patterns.utf8char + S("@!?_"))^1 Many thanks for your help, Pablo -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] issue with character and \xmlprettyprinttext
On 02/20/2018 09:32 AM, Hans Hagen wrote: > On 2/19/2018 10:14 PM, Pablo Rodriguez wrote: >> [...] >> For some strange reason, "\␣" is problematic only when >> \xmlprettyprinttext (or \xmlinlineprettyprinttext) is set to tex. >> >> Is this a bug or am I missing something? > are you sure that the font you use has the character Many thanks for your reply, Hans. The chars are there: \setuptype[option=tex] \starttext \startTEXpage[offset=1em] \type{\ ␣ \ á \ ñ} % \type{\␣ \á \ñ} {\ttbf \letterbackslash ␣ \letterbackslash á \letterbackslash ñ} \stopTEXpage \stoptext The problem is that the \type command and the typing start-stop break when the backslash is followed by a non ASCII character. The commented line shows the issue. I’m afraid it might be a bug. 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 ___
Re: [NTG-context] issue with character and \xmlprettyprinttext
On 2/19/2018 10:14 PM, Pablo Rodriguez wrote: Hans, I have the following sample: \startbuffer[demo] b \␣ \stopbuffer \startxmlsetups xml:initialize \xmlsetsetup{#1}{doc|p|code}{xml:*} \stopxmlsetups \xmlregistersetup{xml:initialize} \startxmlsetups xml:doc \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:p \startpar\xmlflush{#1}\stoppar \stopxmlsetups \startxmlsetups xml:code \xmlprettyprinttext{#1}{tex} \stopxmlsetups \starttext \xmlprocessbuffer{main}{demo}{} \stoptext For some strange reason, "\␣" is problematic only when \xmlprettyprinttext (or \xmlinlineprettyprinttext) is set to tex. Is this a bug or am I missing something? are you sure that the font you use has the character - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ 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 ___