Description
Anchor links <a href="#anchor-link">Anchor Link</a> in document to import will generate corrupted Word document
To Reproduce
Steps to reproduce the behavior:
- Start the AEM Importer
- Force the "Transformation file URL" to a non existing URL to force usage of default import script
- Check "Save as docx"
- Import URL https://www.aami.com.au/
- Try to open the generated .docx => Word will display an error dialog:
Word found unreadable content in index.docx. Do you want to recover the contents of this document? If you trust the source of this document, click Yes.
To confirm it's such elements which create the issue, retry the import with following import script:
export default {
transformDOM: ({ document }) => {
const main = document.body;
// remove all anchor links
main.querySelectorAll('a[href^="#"]').forEach((el) => el.remove());
return main;
},
};
=> The generated docx is OK.
Expected behavior
If such anchor links are not supported, they should be modified/fixed by default
Version:
16.3.15
Description
Anchor links
<a href="#anchor-link">Anchor Link</a>in document to import will generate corrupted Word documentTo Reproduce
Steps to reproduce the behavior:
Word found unreadable content in index.docx. Do you want to recover the contents of this document? If you trust the source of this document, click Yes.To confirm it's such elements which create the issue, retry the import with following import script:
=> The generated docx is OK.
Expected behavior
If such anchor links are not supported, they should be modified/fixed by default
Version:
16.3.15