You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the initial optional moveto? is unnecessary, it is implied by the rest.
this very incorrectly limits the number of moveto to just 1 or 2, only at start of the path (including moveto into drawto_command seems incorrect semantically).
there's missing whitespaces between moveto and drawto_command.
Note also that various SVG renderers and web browsers (and all the "SVG path validators" I found on the Internet) also accept silenttly any trailing comma at end of coordinates or coordinate_pairs, just like if they were whitespace, and in fact all commas are treated by them exactly like whitespace everywhere (including in W3C SVG validator).
The only place where these trailing/extra commas may cause problem and that I found was in the Wikimedia SVG renderer used on their wikis (such as Wikimedia Commons): this is not visible in their SVG file upload preview (apparently the Wikimedia SVG-to-PNG thumbnail renderer is not used in that form as the file in preview is actually not saved and accessible to its renderer, just present in the input form data), the SVG is just shown embedded into the HTML page, and rendered by the web browser and may look correct, until after it is saved, and partly rendered, the rendering stops at the first extra comma).
So I wonder if these comma separators should not just be treated everywhere like whitespaces (as done in most existing SVG or validators and in HTML5 browsers like Google Chrome, Chromium, MSEdge). I have not tested how these "extra" commas behave in Firefox, Safari, or legacy renderers.
The text was updated successfully, but these errors were encountered:
verdy-p
changed the title
incorrect syntax for svg_path in SVG3 draft
incorrect syntax for svg_path in SVG2 draft
Jun 21, 2024
The specification says (https://www.w3.org/TR/SVG/paths.html#PathDataBNF):
svg_path::= wsp* moveto? (moveto drawto_command*)?
but this is still not correct:
moveto?
is unnecessary, it is implied by the rest.moveto
to just 1 or 2, only at start of the path (includingmoveto
intodrawto_command
seems incorrect semantically).moveto
anddrawto_command
.This should just be:
svg_path::= wsp* (moveto wsp* drawto_command*)* wsp*
Note also that various SVG renderers and web browsers (and all the "SVG path validators" I found on the Internet) also accept silenttly any trailing comma at end of coordinates or coordinate_pairs, just like if they were whitespace, and in fact all commas are treated by them exactly like whitespace everywhere (including in W3C SVG validator).
The only place where these trailing/extra commas may cause problem and that I found was in the Wikimedia SVG renderer used on their wikis (such as Wikimedia Commons): this is not visible in their SVG file upload preview (apparently the Wikimedia SVG-to-PNG thumbnail renderer is not used in that form as the file in preview is actually not saved and accessible to its renderer, just present in the input form data), the SVG is just shown embedded into the HTML page, and rendered by the web browser and may look correct, until after it is saved, and partly rendered, the rendering stops at the first extra comma).
So I wonder if these comma separators should not just be treated everywhere like whitespaces (as done in most existing SVG or validators and in HTML5 browsers like Google Chrome, Chromium, MSEdge). I have not tested how these "extra" commas behave in Firefox, Safari, or legacy renderers.
The text was updated successfully, but these errors were encountered: