stable

Clone or download

Read-only

Deal with HTML content containing <div>, <p> and <br> tags

A few basic elements are now managed instead of considering that any text fields written in HTML or CommonMark is just plaintext. The DOM is transformed using a recursive DFS. This approach is quite easy to follow but it might be a source if very deep DOM tree are encountered. However this is not really something we can expect from a text field written by a human (even with less than optimal WYSIWYG editors). The main goal for now is to deal with the conversion of the different HTML elements. Very large DOM can be handled in a next phase if necessary by dropping the recursion and/or cutting part of tree if it becomes too deep. Part of story #22569: export `text` fields Change-Id: I8ca386c97dc0ce378f6a10698245f47209ebfd89

Modified Files

Name
M plugins/document_generation/scripts/tracker-report-action/src/Exporter/DOCX/download-docx.ts +2 −2 Go to diff View file
D plugins/document_generation/scripts/tracker-report-action/src/Exporter/DOCX/transform-html-into-paragraph.test.ts +0 −29 Go to diff View file
D plugins/document_generation/scripts/tracker-report-action/src/Exporter/DOCX/transform-html-into-paragraph.ts +0 −29 Go to diff View file
A plugins/document_generation/scripts/tracker-report-action/src/Exporter/DOCX/transform-html-into-paragraphs.test.ts +58 −0 Go to diff View file
A plugins/document_generation/scripts/tracker-report-action/src/Exporter/DOCX/transform-html-into-paragraphs.ts +96 −0 Go to diff View file
R plugins/document_generation/scripts/tracker-report-action/src/Exporter/DOCX/transform-large-content-into-paragraph.test.ts Go to diff View file
R plugins/document_generation/scripts/tracker-report-action/src/Exporter/DOCX/transform-large-content-into-paragraph.ts Go to diff View file