Diagrams with embedded line breaks (<br>) cause rendering errors unless they're properly converted to XML (<br/>). This will affect any other HTML that gets accidentally embedded.
Using the XMLSerializer is a generic fix, a lot better than trying to create a list of elements to fix.
Also: introduces an error handler that improves the error messaging given to the user, as well as extending error handling to the image rendering phase.
Diagrams with embedded line breaks (
<br>
) cause rendering errors unless they're properly converted to XML (<br/>
). This will affect any other HTML that gets accidentally embedded.Using the XMLSerializer is a generic fix, a lot better than trying to create a list of elements to fix.
Fixes #23.
Using a trick from the Mermaid CLI, see:
https://github.com/mermaid-js/mermaid-cli/blob/f235609053213226c733fa2d7caa87b2839991bb/src/index.js#L311-L312
Also: introduces an error handler that improves the error messaging given to the user, as well as extending error handling to the image rendering phase.