Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header bookmarks #460

Open
domwhewell-sage opened this issue Jun 16, 2024 · 0 comments
Open

Header bookmarks #460

domwhewell-sage opened this issue Jun 16, 2024 · 0 comments

Comments

@domwhewell-sage
Copy link

Is your feature request related to a problem? Please describe.
When adding a link in the tinymce editor you can make it an internal link to a heading ->
(Entering in # makes it an internal hyperlink)
image
The tinymce editor then adds an id attribute to the heading tag, e.g.

<h1 id="h_1741158734421718551414403">Introduction</h1>

This id tag is currently stripped and does not end up as a bookmark in the generated docx

Describe the solution you'd like
The hyperlink currently gets generated correctly
image

But the bookmark does not
image

It would be good if bookmarks could be added into the renderer

Describe alternatives you've considered
I had considered adding in a title_bookmark field to each finding by adding in the function which only adds in the rich text

def bookmark_rich_text(self, text, url):
        bookmark = RichText()
        bookmark.xml = '<w:bookmarkStart w:id="" w:name="{}"/>{}<w:bookmarkEnd w:id=""/>'.format(url, text)
        return bookmark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant