Closed jupiter007 closed 3 weeks ago
3. Then I added my regex fix, and downloaded the
.docx
file again. You can see the missing content is now present, and the formatting looks the same as in the originally entered text in the plan:
Thank you for pointing that out @briri.
We recently discovered that text in exported .docx plans was sometimes missing.
I did some research into it and it appears that docx is not happy when there is a tag, then some text or characters, then a
tag. All content after thetag all within a
tag, within that tag is somehow not included in the exported plan.
Fixes #647
Changes proposed in this PR:
.gsub()
replacement regex to theclean_html_for_docx_creation(html)
function inplan_exports_controller.rb
. This should find those cases described above, and replace the<br>
tag with a closing</p>
and an opening<p>
tag.Testing:
"Public Repositories: Published data will be deposited in publicly accessible repositories such as the Electron Microscopy Data Bank (EMDB) and the Protein Data Bank (PDB) for long-term access and preservation. Constructs and Reagents:"
"Direct Requests: Researchers can email redacted name for privacy to request reagents and materials needed to duplicate the data, facilitating reproducibility and collaboration."
I then downloaded a
.docx
file WITHOUT my regex fix. You can see where the missing content should be in the outlined red boxes:Then I added my regex fix, and downloaded the
.docx
file again. You can see the missing content is now present, and the formatting looks the same as in the originally entered text in the plan: