Skip to content

Commit

Permalink
3522: undoing Formatter changes to keep tests green and doing everyth…
Browse files Browse the repository at this point in the history
…ing "inside" ftl
  • Loading branch information
t.eitzenberger committed Sep 5, 2024
1 parent b29568d commit 9489abf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@
<#list breadcrumbs as breadcrumb>
<#assign breadcrumbReport = absoluteReportName.forRequirement(breadcrumb) />
<#assign breadcrumbTitle = breadcrumb.displayName > <!-- inflection.of(breadcrumb.displayName).asATitle()-->
> <a href="${breadcrumbReport}">${formatter.htmlCompatibleStoryTitle(breadcrumbTitle)}</a>
> <a href="${breadcrumbReport}">
${formatter.escapeHtmlTags(formatter.htmlCompatibleStoryTitle(breadcrumbTitle))}
</a>
</#list>
<#-- > ${formatter.htmlCompatibleTestTitle(formatter.renderTitle(testOutcome.title))}-->
<#-- > ${formatter.htmlCompatibleTestTitle(testOutcome.title)}-->
> ${formatter.htmlCompatibleTestTitle(formatter.humanReadableFormOf(testOutcome.title))}
>
${formatter.escapeHtmlTags(formatter.htmlCompatibleTestTitle(formatter.humanReadableFormOf(testOutcome.title)))}
</span>
</div>
<div class="rightbg"></div>
Expand Down Expand Up @@ -346,7 +349,7 @@
<#assign roeResult = row.result/>
</#if>
<td class="test-${roeResult}"><a
href="#${rowIndex}">${formatter.plainHtmlCompatible(value)}</a>
href="#${rowIndex}"><#outputformat 'HTML'>${formatter.plainHtmlCompatible(value)}</#outputformat></a>
</td>
</#list>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
<#assign roeResult = row.result/>
</#if>
<td class="test-${roeResult}"><a
href="#${rowIndex}">${formatter.plainHtmlCompatible(value)}</a>
href="#${rowIndex}"><#outputformat 'HTML'>${formatter.plainHtmlCompatible(value)}</#outputformat></a>
</td>
</#list>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,7 @@ private String newLineUsedIn(String text) {

private static final CharSequenceTranslator ESCAPE_SPECIAL_CHARS = new AggregateTranslator(
new LookupTranslator(EntityArrays.ISO8859_1_ESCAPE()),
new LookupTranslator(EntityArrays.HTML40_EXTENDED_ESCAPE()),
new LookupTranslator(new String[][] { {"<", "&lt;"}, {">", "&gt;"}})
new LookupTranslator(EntityArrays.HTML40_EXTENDED_ESCAPE())
);

private final CharSequenceTranslator BASIC_XML = new AggregateTranslator(
Expand Down Expand Up @@ -481,6 +480,10 @@ public String htmlCompatibleStoryTitle(Object fieldValue) {
(htmlCompatible(renderMarkdownWithoutTags(firstLine))) : htmlCompatible(firstLine);
}

public String escapeHtmlTags(String fieldValue) {
return fieldValue.replace("<", "&lt;").replace(">", "&gt;");
}

public String htmlCompatibleTestTitle(Object fieldValue) {
String firstLine = fieldValue.toString().split("\\n")[0];

Expand Down

0 comments on commit 9489abf

Please sign in to comment.