Skip to content

Commit

Permalink
Title Line Breaks Cause Issues in JSON File (#50)
Browse files Browse the repository at this point in the history
This seems related to issue #47 , but it's showing up in a different
place. Here, it seems that the line breaks are not being escaped in the
resulting lunr.json file for the search functionality.

## Suggested resolution
As the whitespace in a title (whether intentional or not) isn't really
relevant to the search functionality, simply using the same replace
function in xpath as is used elsewhere in the `data-to-json.xsl` file
seems a simple and consistent fix for this issue.
  • Loading branch information
jason-fox committed May 27, 2024
2 parents 4a1adcf + 4afb9e6 commit 47123a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xsl/data-to-json.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<xsl:text>",</xsl:text>

<xsl:text>"t": "</xsl:text>
<xsl:value-of select="dita-ot:escapeQuote(@title)"/>
<xsl:value-of select="normalize-space(dita-ot:escapeQuote(@title))"/>
<xsl:text>",</xsl:text>

<xsl:text>"k": "</xsl:text>
Expand Down

0 comments on commit 47123a1

Please sign in to comment.