1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 05:09:42 +02:00
documize/core/api/convert/html
2022-03-16 13:32:27 -04:00
..
doc.go more gofmt 2016-10-17 14:07:05 -07:00
html.go Go 1.18 & tidy deps 2022-03-16 13:32:27 -04:00
html_test.go more gofmt 2016-10-17 14:07:05 -07:00
README.md restructure directories 2016-07-20 15:58:37 +01:00

How the HTML conversion works

Uses the "golang.org/x/net" repository package "html" to parse the HTML into a tree, then walks the tree using processHeadings() to make a series of sections with a heading as their title and the following HTML as the body.

Importantly, if a heading is within some other structure, that other structure is ignored in order to get the heading into the list. This seems to mostly work well, but may have some unintended side-effects.

On the subject of unintended side-effects, or rather their avoidance, "script" HTML tags and their contents are not passed through.