Hello,

the first episode was more dramatic than expected, seem to be a good series.

On Thu, Apr 22, 2021 at 11:36 AM Hans Hagen <j.hagen@xs4all.nl> wrote:
On 4/21/2021 8:17 PM, Jano Kula wrote:

> Does unicode nbsp have fixed with in ctx?

sometimes ... but you just uncovered an old bug
     if attr >= 1 or attr <= 3 then -- flushright
someplace should be
     if attr >= 1 and attr <= 3 then -- flushright
 
After the patch, nbsp is working as expected.

On Thu, Apr 22, 2021 at 8:03 AM Taco Hoekwater <taco@bittext.nl> wrote:

the preprocessor converts XML into *other* XML.

Useful information, thanks, wikified.

And tilde in XML is just that: the ascii tilde glyph.

Yep, but \xmlfilter can process them nicely. See some next episode.
 
for fine-tuning XML output I would use a trick like this:

\startluacode
function lxml.preprocessor(data)
    return string.gsub(data, "&amp;nbsp;", "<nbsp/>")
end
\stopluacode

\startxmlsetups xml:name
    \xmlsetsetup{\xmldocument}{document|nbsp}{xml:name:*}
\stopxmlsetups

\startxmlsetups xml:name:nbsp
    \penalty10000\hskip .3em plus 2em % or something, just a wild example.
\stopxmlsetups

Using an xml element would also allow your code to ‘look around’ to make sure all is
well with its (typesetting) environment.

It didn't occur to me to change it by preprocessor to the new xml elements.
You are right, one can even have more control.

Thank you all for your help,
Jano

And thanks for watching!