[NTG-context] SVG style ignored after double semicolon

Thangalin thangalin at gmail.com
Sun May 8 10:33:15 CEST 2022


Hey hey,

The following produces a filled square, rather than an empty one:

\startbuffer[svg]
<svg>
  <rect width="100" height="100"
        style="stroke:rgb(0,0,0);;fill:none" />
</svg>
\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext

Remove the extra semicolon to get the expected result:

<svg>
  <rect width="100" height="100"
        style="stroke:rgb(0,0,0);fill:none" />
</svg>

It appears that a style immediately following two semicolons is ignored.

The SVG was generated using the following R code:

svg("filename.svg");
plot(rnorm(200));
dev.off()

Arguably, R's SVG routines could be a bit tighter. Can the MP SVG parser
code be relaxed to skip "empty" semicolons?

$ context --version
mtx-context     | current version: 2022.05.02 16:19

Much appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220508/b99084cd/attachment-0001.htm>


More information about the ntg-context mailing list