Roave / DocbookTool

:books: Docbook Tool for static documentation generation from Markdown files
52 stars 4 forks source link

Use DOM manipulation when replacing HTML elementattributes #377

Open Ocramius opened 2 months ago

Ocramius commented 2 months ago

_Originally posted by @Ocramius in https://github.com/Roave/DocbookTool/pull/376#discussion_r1572582967_

We should look into getting rid of string replacements, and using DOM manipulation for HTML replacements, where possible.

This is NOT a security issue because this tool is intended for use on repository sources, NOT user input.

Ocramius commented 2 months ago

Mandatory Zalgo: https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags

asgrim commented 2 months ago

I've started work on this, although it will need a lot more time put into it than initially anticipated, as the resulting HTML is not quite right. Branch with my progress so far is at https://github.com/Roave/DocbookTool/tree/use-dom-manipulation-for-confluence-writer (but note: it is failing, and very much WIP! not ready for PR review yet)