Open GlennPlou opened 3 months ago
Indeed, this can have an impact on the importer. The idea behind the second commit in this PR is to have a consistent behavior for the method transformHTMLToText(String, String)
. I am not sure whether we want to transform only the quotes, or if only the angle brackets should not be transformed, or if it is an error and all special characters should be transformed. I don't know how to use the importer to check what is displayed to the user.
In fact, when I wanted to add a unit test for LabelHelper.transformHTMLToText
with RequirementsPreferencesConstants.REQUIREMENT_KEEP_XHTML_TAGS
set to true
, the string
"<xhtml:div>Capella "<is>" great <xhtml:a href=\"to%20.pdf\">here</xhtml:a></xhtml:div>"
is transformed into
"<div>Capella "<is>" great <a href=\"to%20.pdf\">here</a></div>"
,
while with the preference set to false
, the result is
"Capella \"<is>\" great here"
.
Given the naming, the method transformHTMLToText
should transform the special characters, regardless of the preference value.
After tests, it's ok for the previous comment. The import when we keep tags is working as originally expected, the display was not relevant for the user using the preference. Now the display is improved so it looks better than before.
If it's all good/finished for you, can we merge it ?
No go to merge yet. We need to discuss with our team. We're afraid of the impact it could have on M2Doc or DocGen, for example. In addition, we think that the aql expressions used for the label and content of Requirements could be moved into a service, and include the “transformHTMLToText” process, rather than using it in a post-process. Also, I finally understood the impact this could have on the importer and dialog invoked by the palette's Requirements tool. See this comment.
Quality Gate passed
Issues
1 New issue
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
See analysis details on SonarCloud