-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] Improper XML and DOCTYPE Declarations #97
Comments
The svg doctype is generated by graphviz itself. The best way to deal with this would be a complete refactor of HTML generation, using a library. I'm not amazing at python, but I found a couple that can be tried. |
I know that, but it's not hard to filter out the leading declarations before embedding the rest of the SVG file.
I cannot see how a library will solve this issue. It might be a good idea for other reasons, but that belongs in a separate issue. If we want to add proper leading declarations, then it's easy to include them in the first The question is: Do we want any of these declarations at all? |
My thought was that if we use the xml.dom.minidom library, we can easily strip out or modify tags as necessary from the Graphviz SVG. Similarly, if we use that library, or a similar one for HTML, we can then just pass an object instead of repeatedly reading and writing files. The doctype and meta tags are probably pretty important for W3C compliance 1 2, if we care about that. A proper XML declaration does help, but a meta encoding tag in HTML is also needed (I implemented in #96 ) |
The W3C Markup Validation Service complained with these errors:
|
Thanks for the PR, this fixes the primary issue. The other minor issues should be addressed as part of #32 and the feature/technical-drw branch. |
The https://validator.w3.org/ reported Errors: The align attribute on the th/td element is obsolete. Use CSS instead. By replacing align="X" attributes with text-align:X; CSS equivalent, the validator now completes without any errors or warnings. This solves the remaining issues from wireviz#97.
The https://validator.w3.org/ reported Errors: The align attribute on the th/td element is obsolete. Use CSS instead. By replacing align="X" attributes with text-align:X; CSS equivalent, the validator now completes without any errors or warnings. This solves the remaining issues from wireviz#97.
The https://validator.w3.org/ reported Errors: The align attribute on the th/td element is obsolete. Use CSS instead. By replacing align="X" attributes with text-align:X; CSS equivalent, the validator now completes without any errors or warnings. This solves the remaining issues from wireviz#97.
The https://validator.w3.org/ reported Errors: The align attribute on the th/td element is obsolete. Use CSS instead. By replacing align="X" attributes with text-align:X; CSS equivalent, the validator now completes without any errors or warnings. This solves the remaining issues from #97.
The HTML output violates these rules:
The root cause is that
Harness.output()
start HTML output withfile.write('<html><body style="font-family:Arial">')
(i.e. no leading XML or DOCTYPE declarations) and then later embed the SVG diagram into the HTML output without hiding (remove or comment) the leading XML and DOCTYPE declarations from the SVG file.If we are including XML and/or DOCTYPE declarations, then we should comply to their rules. Related issues I have not investigated:
Harness.output()
comply to identical XML or DOCTYPE declarations as the SVG file?encoding="UTF-8"
be of any help in issue [BUG] Unicode characters render improperly on Windows #52 ?The answer is no to both questions above, as show in my comment below with errors from the W3C Markup Validation Service.
The text was updated successfully, but these errors were encountered: