Skip to content

Create bookmarks for HTML elements with an id #219

@manfromarce

Description

@manfromarce

HTML elements with an id can be used as anchor for internal and external hyperlinks pointing to a specific part of a page. It seems that the converter does not create an equivalent bookmark in the DOCX document, or at least not when there is no link pointing to the anchor.

In my case I am appending multiple HTML files to the same Word document, and sometimes there are links such as file2.html#anchor1. In the second file, there is an element such as <h1 id="anchor1">. To fix these kind of links in the merged document, the file name is removed by my code before passing the HTML to HtmlToOpenXml, so that "#anchor1" remains. The link is properly created but on the second file no bookmark is created. I would expect the converter to do this automatically or to provide a possible workaround.

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