ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Thangalin via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Thangalin <thangalin@gmail.com>
Subject: Re: SVG style ignored after double semicolon
Date: Mon, 9 May 2022 13:03:13 -0700	[thread overview]
Message-ID: <CAANrE7rbnud++X_CM=C5_Ejt1Cni6G26B-TfRXAKVXAM1M8R8Q@mail.gmail.com> (raw)
In-Reply-To: <85A94842-FECF-454B-BFD0-B13EFF4C2786@me.com>


[-- Attachment #1.1: Type: text/plain, Size: 1335 bytes --]

> gsed ’s/;;/;/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=";;")

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?

[-- Attachment #1.2: Type: text/html, Size: 1664 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2022-05-09 20:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-08  8:33 Thangalin via ntg-context
2022-05-08 19:06 ` Thangalin via ntg-context
2022-05-09  6:10   ` Thangalin via ntg-context
2022-05-09  8:55     ` Heinrich Paeßens via ntg-context
2022-05-09 15:42       ` Thangalin via ntg-context
2022-05-09 17:01         ` Heinrich Paeßens via ntg-context
2022-05-09 20:03           ` Thangalin via ntg-context [this message]
2022-05-09 23:01           ` Heinrich Paeßens via ntg-context
2022-05-09 23:17             ` Thangalin via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAANrE7rbnud++X_CM=C5_Ejt1Cni6G26B-TfRXAKVXAM1M8R8Q@mail.gmail.com' \
    --to=ntg-context@ntg.nl \
    --cc=thangalin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).