From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/111147 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jano Kula Newsgroups: gmane.comp.tex.context Subject: Re: nbsp in XML (S01E01) Date: Fri, 23 Apr 2021 20:01:43 +0200 Message-ID: References: <4e3e53ba-c42b-f4c1-5a24-d569e662dc2d@xs4all.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1169478554289125082==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="712"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Fri Apr 23 20:02:53 2021 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 1la08i-000AeK-My for gctc-ntg-context-518@m.gmane-mx.org; Fri, 23 Apr 2021 20:02:52 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6675F282BC9; Fri, 23 Apr 2021 20:02:24 +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 zcmU_BaV1bWl; Fri, 23 Apr 2021 20:02:23 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 81F5B282BCA; Fri, 23 Apr 2021 20:02:23 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1CB22282BC8 for ; Fri, 23 Apr 2021 20:02:22 +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 PIZ4EdLVPRCD for ; Fri, 23 Apr 2021 20:02:21 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.210.41; helo=mail-ot1-f41.google.com; envelope-from=jano.kula@gmail.com; receiver= Original-Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 3F158282BC6 for ; Fri, 23 Apr 2021 20:02:21 +0200 (CEST) Original-Received: by mail-ot1-f41.google.com with SMTP id 35-20020a9d05260000b029029c82502d7bso14611171otw.2 for ; Fri, 23 Apr 2021 11:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pPEZ0freDbRJC5q6SqJn4vvBnUFLTMGRF+gY3BxdEUQ=; b=gsb9GVFV9K6Rd4EN3qaiVhRPYjL+s538ha50QgKtJfoJpFXOZrr8gqZlwe1lUgr9Vu kX3CrqJRXBwG2UGA4NaeXrhINVLyKyYb9nWzuRQmE0xORDCPxbFK1JQyaob+LcjbnQL0 9TU4I992zks8B/abirSCuWNE5TN45CxcQBZjZvfuoldKScXIa8NajHO7xdf+tFQ9fsIX WkECAIStDL+gXXkTYZ8Tw0O9TmBd3WzgxngOACJk8gQ/aDvqihDCd4VxY4axs5irIb0i BhhD3Yj6iYbskGAtbekw21x1w8Uf3fNkK2VpX1vlRK5IvwbrhRBw/dBD2RXBO9a9EqgV 5nyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pPEZ0freDbRJC5q6SqJn4vvBnUFLTMGRF+gY3BxdEUQ=; b=Z+4+56G5922lhJA1+hQPlWEF7nXwVjGRbXSF+i/wgTE38XMhPm7USF4Md0u1ISYbyF NO0THSP9u4cRt1LDPGaugphNh0jEXmBYrmQaW3L05n5/nDSHSn4I4BEIqciUNjRcH2m1 wNePbxjr+DT4KYZxFEm/gg0sRRmQwnZAMQO6K/cXywPoZuc2wMdHpfcCYqc71+pxIcwC JaP3gZ6jMfDLyJxbI+5WTppA9wY1SxbzpIXPrWWmq3OG1i91T3a/QW+r03g/yZR+nLg8 OZh1F1c1cVu9cg401rF/6brpDVFJTcMUg1F7hGMzkULM7jbW8tWIkHJlVFA/iKU5v7kd nvqQ== X-Gm-Message-State: AOAM530ntGgGTqNH9IlFzHrJLFe0JcoIV7SxEY9XuabSt37hMGuvCZ13 o6MMYSgqfGVxQE+bnw6YlyWZQNg1uwJhCd8xi9g= X-Google-Smtp-Source: ABdhPJxExV2UMuliLgASSNaQtThj9a/cNk7IGsGK+3Yjpc4ST2fohCbIMflq08sZIl1EOK9c5Ho5uebIMsy6CDaE5lM= X-Received: by 2002:a9d:f28:: with SMTP id 37mr4673370ott.286.1619200939590; Fri, 23 Apr 2021 11:02:19 -0700 (PDT) In-Reply-To: <4e3e53ba-c42b-f4c1-5a24-d569e662dc2d@xs4all.nl> 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:111147 Archived-At: --===============1169478554289125082== Content-Type: multipart/alternative; boundary="000000000000d3061405c0a7989e" --000000000000d3061405c0a7989e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 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 >=3D 1 or attr <=3D 3 then -- flushright > someplace should be > if attr >=3D 1 and attr <=3D 3 then -- flushright After the patch, nbsp is working as expected. On Thu, Apr 22, 2021 at 8:03 AM Taco Hoekwater 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, "&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 =E2=80=98look around= =E2=80=99 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! --000000000000d3061405c0a7989e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

the first episode was more dramatic than expected, seem to be a good seri= es.

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
=C2=A0 =C2=A0 =C2=A0if attr >=3D 1= or attr <=3D 3 then -- flushright
someplace should be
=C2=A0 =C2= =A0 =C2=A0if attr >=3D 1 and attr <=3D 3 then -- flushright
=C2=A0
After the patch, nbsp is working as e= xpected.

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,=C2=A0wikified.

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

Yep, b= ut=C2=A0\xmlfilter=C2=A0can process them ni= cely. See some next episode.
=C2=A0
for fine-tuning XML output I would use a trick like this:

\star= tluacode
function lxml.preprocessor(data)
=C2=A0 =C2=A0 return string= .gsub(data, "&amp;nbsp;", "<nbsp/>")
end\stopluacode

\startxmlsetups xml:name
=C2=A0 =C2=A0 \xmlsetsetu= p{\xmldocument}{document|nbsp}{xml:name:*}
\stopxmlsetups

\startx= mlsetups xml:name:nbsp
=C2=A0 =C2=A0 \penalty10000\hskip .3em plus 2em %= or something, just a wild example.
\stopxmlsetups

Using an xml e= lement would also allow your code to =E2=80=98look around=E2=80=99 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 co= ntrol.

Thank you all for your help,
Jano

And thanks for watching!=C2=A0
--000000000000d3061405c0a7989e-- --===============1169478554289125082== 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== --===============1169478554289125082==--