Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 1.37 KB

File metadata and controls

25 lines (15 loc) · 1.37 KB

Development

Input and output trees

convert accepts an MDHTML string or an existing fast5ever node. Strings are parsed once by mdhtml.parse_mdhtml. Converter code walks fast5ever's element, text, and comment nodes in document order; it does not project them into an XML tree.

lxml remains the output library. It builds WordprocessingML parts, reads the reference archive's XML, and validates the resulting docx. Keeping the input and output types distinct prevents XML name, comment, namespace, and well-formedness rules from leaking into MDHTML handling.

Body-level phrasing runs are grouped into implicit Word paragraphs according to the MDHTML dialect. HTML template contents remain outside the ordinary child sequence and are inert. Raw docx scripts are decoded at the point where they are converted into WordprocessingML.

Tests

Install the workspace after dependency or package-name changes, then run:

pytest -q

The default suite validates generated archives and reads them back through pandoc. Tests marked slow exercise live GUI applications or other long-running checks:

pytest -q -m slow

tests/test_validate.py checks the zip container, XML, relationships, and ECMA-376 schemas. The committed reference document and schemas remain binary/XML assets; input MDHTML fixtures should use ordinary HTML serialization rather than XHTML spellings.