DocbookTool icon indicating copy to clipboard operation
DocbookTool copied to clipboard

Check for invalid HTML

Open asgrim opened this issue 1 year ago • 1 comments

diff --git a/test/fixture/docbook/test.md b/test/fixture/docbook/test.md
index fe86218..0d4a9f7 100644
--- a/test/fixture/docbook/test.md
+++ b/test/fixture/docbook/test.md
@@ -22,6 +22,10 @@ This is some markdown
 }
 ```
 
+## Test invalid HTML
+
+This particular part <has> some <invalid> HTML tags. This breaks Confluence!
+
 ## Subtitle
 
 Links [here](https://www.google.com). **Bold**, _italic_, ~~strikethrough~~, `inline code`.

Applying this diff to the test fixtures will generate invalid HTML. We should add a check after generating the HTML that it is valid.

To reproduce:

  • Apply the above addition to the test fixture
  • Run make test-output to generate the build/index.html
  • Upload/copy the contents of build/index.html into the W3 Validator

Observation:

Screenshot from 2024-01-02 09-27-22

Perhaps there is a validator library to do this, so we can pass it through there before proceeding?

asgrim avatar Jan 02 '24 09:01 asgrim

It should be possible to do local DTD validation 🤔

Ocramius avatar Jan 02 '24 09:01 Ocramius