> 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?
___________________________________________________________________________________
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 via email to