Skip to content

Commit

Permalink
fixing display issues when using <> or \" characters in scenario outl…
Browse files Browse the repository at this point in the history
…ine titles / data table values (#3524)
  • Loading branch information
eitzenbe authored Sep 5, 2024
1 parent 8368742 commit 38f02ca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 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 @@ -481,6 +481,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 38f02ca

Please sign in to comment.