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

Complex fields are not always closed correctly #332

Open
tripodsan opened this issue Jul 26, 2022 · 0 comments
Open

Complex fields are not always closed correctly #332

tripodsan opened this issue Jul 26, 2022 · 0 comments

Comments

@tripodsan
Copy link
Contributor

tripodsan commented Jul 26, 2022

see http://officeopenxml.com/WPfields.php
the complex fields should be enclosed with a <w:fldChar> element with an attribute fldCharType value of begin and
ended with one with the value of end.

I have a document with a HYPERLINK field, where the end is wrapped in a <w:del> element (don't know how the author managed to do this :-) :

            <w:r w:rsidR="603DAB17">
                <w:fldChar w:fldCharType="begin"/>
            </w:r>
            <w:r w:rsidR="603DAB17">
                <w:instrText xml:space="preserve">HYPERLINK "https://rewards.adobe.com/" </w:instrText>
            </w:r>
            <w:r w:rsidR="00000000">
                <w:fldChar w:fldCharType="separate"/>
            </w:r>
            <w:del w:id="0" w:author="John Doe" w:date="2022-07-21T00:44:00Z">
                <w:r w:rsidR="603DAB17">
                    <w:fldChar w:fldCharType="end"/>
                </w:r>
            </w:del>

In this case, all following paragraphs are wrapped with a hyperlink. I suspect that the <w:fldChar w:fldCharType="end"/> is not detected inside the <w:del> element.

I will try to create a PR with a test soon.

@tripodsan tripodsan changed the title Hyperlink complex fields are not closed correctly Complex fields are not always closed correctly Jul 26, 2022
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