Skip to content

Ability to convert into header/footer #162

@onizet

Description

@onizet

Currently, the implementation only support parsing html into the body (document MainPart).
The OpenXml SDK is slightly different (for example, you cannot have footnote reference in header/footer, or having a clickable image etc...)

90% of the time, users insert the parsed Html inside their own docx template, thus reusing a predefined header and footer.

I'm creating this work item for follow-up on the new feature request.
I'm thinking of providing methods such : converter.ParseHeader() converter.ParseFooter() and converter.ParseBody() (instead of converter.ParseHtml which is confusing)

Another solution, would be to automatically detect the first body > header and the last body > footer. Or more specifically, MDN, any element with the ARIA role="banner" specifies:

By default, the HTML's <header> element has an identical meaning to the banner landmark, unless it is a descendant of <aside>, <article>, <main>, <nav>, or <section>, at which point <header> exposes a generic role, and not the equivalent of the site-wide banner.

What are your though? @mesquidar @jstangle

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions