Skip to content

Commit

Permalink
#154 Fixed xhtml tags (#157)
Browse files Browse the repository at this point in the history
Change-Id: If6891a61300257848bd26ce7232079f76a47a61c
Signed-off-by: MalinaStefaniaStoicanescu <malina.stoicanescu@thalesgroup.com>
  • Loading branch information
MalinaStefaniaStoicanescu committed Jan 7, 2022
1 parent d96a623 commit 9d91692
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ <h3 id="Default_configuration">Default configuration</h3>
RCM Version
IE Req Version
</pre>
<h3 id="Keep_original_HTML_format_for_all_fields">Keep original HTML format for all fields</h3>
<p>
<img border="0" src="../../images/preferenceHtmlTags.png"/>
</p>
<p>The users are able to choose to display the HTML tags in Capella when importing a .reqif file by checking the 'Keep original HTML format for all fields' preference.</p>
<p>
<img border="0" src="../../images/htmlTags.png"/>
</p>
<h3 id="Add_custom_attributes">Add custom attributes</h3>
<p>There are 2 means to add custom attributes: use Properties files or use Eclipse extensions points.</p>
<h4 id="1._Use_Properties_Files">1. Use Properties Files</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ RCM Version
IE Req Version
</pre>

=== Keep original HTML format for all fields ===

[[Image:../../images/preferenceHtmlTags.png]]

The users are able to choose to display the HTML tags in Capella when importing a .reqif file by checking the 'Keep original HTML format for all fields' preference.

[[Image:../../images/htmlTags.png]]

=== Add custom attributes ===
There are 2 means to add custom attributes: use Properties files or use Eclipse extensions points.

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private void createAttributesSelectionSection(Composite container) {

private void createKeepXHTMLCheckBox(Composite container) {
keepXHTMlTags = new BooleanFieldEditor(RequirementsPreferencesConstants.REQUIREMENT_KEEP_XHTML_TAGS
, "Keep XHTML tags", container) {
, "Keep original HTML format for all fields", container) {
@Override
public IPreferenceStore getPreferenceStore() {
return doGetPreferenceStore();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ public static String transformHTMLToTextWithLineFeed(String content) {
Boolean keepXhtmlTages = (Boolean) ReqImporterPreferencesUtil
.getValueForPreferenceKey(RequirementsPreferencesConstants.REQUIREMENT_KEEP_XHTML_TAGS, Boolean.class);
if (!keepXhtmlTages) {
content = content.replace("<xhtml:br/>", " ").replaceAll("<[^>]*>", "").trim();
content = content.replaceAll("<xhtml:br/>", " ").replaceAll("<[^>]*>", "").trim();
}
content = content.replaceAll("(?!</xhtml)(?!<xhtml)<[^>]*>", "").replace("xhtml:", "");
// Decode special characters
content = URI.decode(content);
// Unescape HTML special character entities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public class KeepXHTMLTagsTest extends BasicTestCase {

private final String BR_TAG = "<xhtml:br/>";
private final String BR_TAG = "<br/>";
private String testString = "Test text<xhtml:br/>";
private IPreferenceStore store = RequirementsPreferencesPlugin.getDefault().getPreferenceStore();

Expand Down

0 comments on commit 9d91692

Please sign in to comment.