From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/114899 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thangalin via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: SVG style ignored after double semicolon Date: Mon, 9 May 2022 13:03:13 -0700 Message-ID: References: <85A94842-FECF-454B-BFD0-B13EFF4C2786@me.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2867941639108802364==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19139"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Thangalin To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon May 09 22:04:17 2022 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 1no9c8-0004jA-Ce for gctc-ntg-context-518@m.gmane-mx.org; Mon, 09 May 2022 22:04:16 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A1BCA3606C3; Mon, 9 May 2022 22:03:33 +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 IsajiqfwsIoE; Mon, 9 May 2022 22:03:31 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C8A453606E5; Mon, 9 May 2022 22:03:30 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 266D23606E5 for ; Mon, 9 May 2022 22:03:29 +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 3kDGXYIh2k1y for ; Mon, 9 May 2022 22:03:28 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.208.177; helo=mail-lj1-f177.google.com; envelope-from=thangalin@gmail.com; receiver= Original-Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (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 E41EB3606C3 for ; Mon, 9 May 2022 22:03:27 +0200 (CEST) Original-Received: by mail-lj1-f177.google.com with SMTP id bx33so7504585ljb.12 for ; Mon, 09 May 2022 13:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=4WsdYsZdGWwLCu913vl0X7z/PGKpFDg4TO/+4p9YCgs=; b=Kpty/g+e9M185zyPIEjxigWZA1nT8b1Wium4puBFCAenz5A6Jnr3ZYfhMH2wWZjiSP sX8faZ592TVIoF3K/FRr7EaoUMI+wEtz1TzWtlCcgg7sIOEIoB8Btyr34TzaS78bjh6T lUHUC6GIqWbs78mavw3GflOX1FkKFP59h/2Gi9p2YLW2Kz+Gr69WxNagCnctOFgHPYWb MjkinM5No1gcPPKC9uVzVoYPcpdT2RBCKlf4SLvMW65M/pwvvFtFwTrpv/WASIZpyXOk +btm9Tya6UAckaTAqrTc94JZv7mMw7kCzrAPU/DN1XzCSXQc+l0naOIA+jpP5Nx50lrh fVoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=4WsdYsZdGWwLCu913vl0X7z/PGKpFDg4TO/+4p9YCgs=; b=DJAmlJEtyviIIGvTz2EO4HPndnYp0NyE+AVBFJtWzxo1K4+J41KL+/oOrJwLM21B/x d0f28meRKDGRBwh9wuoahM/uyGxz9sOruEHDQ7kICJHUhrpkXpOXRo99pWD+Jp6ssR+m AS21u4yjmzTkMXXG/jj5uRvfdKB/luc0wCN6s7+JP4C4p3Rs8mqfD0hHDAg/vVhVVFuE puuHzJW2azpMmFsovo6/kF8NTnmM3quBtByBt6l3KGMV4fPWIzOi/CKoFWuXguEqrmWo Fs2t17k4p1ks4HV6C9B2C+664y7gfR5XnjupFpXWiQES7HMwb8KiM7ARrC1obUIWCoEE /Hjg== X-Gm-Message-State: AOAM533tlOuGf7HKZiygOXC0Zto4euib+xHkIYt02T3TQSvzIKq042as nBD+nDLVpZLeiMpV8U5zBRoo5dVPrCkffrcVHuwrOUYrvgE= X-Google-Smtp-Source: ABdhPJxXO8NfMhIn1Ljh2drI+sN4Y7xEtmx6NUVgb9/AOoDv4cyGMiIOlab0YghMmk0hwxRO3CddCRaNhBgQlK/lGvI= X-Received: by 2002:a2e:b056:0:b0:250:84ca:643b with SMTP id d22-20020a2eb056000000b0025084ca643bmr11812918ljl.98.1652126604838; Mon, 09 May 2022 13:03:24 -0700 (PDT) In-Reply-To: <85A94842-FECF-454B-BFD0-B13EFF4C2786@me.com> 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:114899 Archived-At: --===============2867941639108802364== Content-Type: multipart/alternative; boundary="00000000000067cbf805de99b310" --00000000000067cbf805de99b310 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > gsed =E2=80=99s/;;/;/g' in.svg > out.svg If a user has an SVG text element where ";;" goes into the document, then that'd make for an awfully awkward user experience and obscure bug to fix. For example: plot(rnorm(5), xlab=3D";;") Meaning, the document must be loaded, parsed, and all style/class elements sanitized. KeenWrite performs real-time rendering of documents. The code to preview the document is shared by the code that exports to XHTML for ConTeXt to render. Effectively, this would be parsing the SVG document twice, which would bog down the previewer. Changing the regexes in mlib-svg.lmt to forgive empty styles seems like the most efficient and flexible approach, which follows the robustness principle: "be conservative in what you send, be liberal in what you accept." The specs for CSS styles are ambiguous as to whether property declarations are required: https://www.w3.org/TR/2001/PR-SVG-20010719/styling.html#StyleAttribute I've since learned that Renjin uses JFreeSVG to produce the SVG file. I've logged a bug against JFreeSVG to avoid the double semicolon. However, this means waiting for a fix from JFreeSVG and then waiting for that fix to be integrated into Renjin. It'll probably be months before that'll happen. (The last release of Renjin was like 10 months ago.) Thoughts? --00000000000067cbf805de99b310 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> gsed =E2=80=99s/;;/;/g' in.svg > out.svg<= /div>

If a user has an SVG text element where ";;&q= uot; goes into the document, then that'd make for an awfully awkward us= er experience and obscure bug to fix. For example: plot(rnorm(5), xlab=3D&q= uot;;;")

Meaning, the document must be lo= aded, parsed, and all style/class elements sanitized. KeenWrite performs re= al-time rendering of documents. The code to preview the document is shared = by the code that exports to XHTML for ConTeXt to render. Effectively, this = would be parsing the SVG document twice, which would bog down the previewer= .

Changing the regexes in mlib-svg.lmt to forgive = empty styles seems like the most efficient and flexible approach, which fol= lows the robustness principle: "be conservative in what you send, be l= iberal in what you accept."

The specs for CSS= styles are ambiguous as to whether property declarations are required:
=


I've since l= earned that Renjin uses JFreeSVG to produce the SVG file. I've logged a= bug against JFreeSVG to avoid the double semicolon. However, this means wa= iting for a fix from JFreeSVG and then waiting for that fix to be integrate= d into Renjin. It'll probably be months before that'll happen. (The= last release of Renjin was like 10 months ago.)

T= houghts?
--00000000000067cbf805de99b310-- --===============2867941639108802364== 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== --===============2867941639108802364==--