diff --git a/CHANGELOG.md b/CHANGELOG.md index 314e65bd..95eecc92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -100,3 +100,9 @@ For each PR made, an entry should be added to this changelog. It should contain - Added universal search functionality tests - Created search pane filter tests - Added pattern application form tests with validation checks + +- 1101-bug-fix-quotes-not-escaped-in-titles + - Description: Title rules that include single quotes show up correctly in the sinequa frontend (and the COSMOS api) but not in the delta urls page. + - Changes: + - Added `escapeHtml` function in the `delta_url_list.js` file to handle special character escaping correctly. + - Called this function while retrieving the titles in `getGeneratedTitleColumn()` and `getCuratedGeneratedTitleColumn()` functions. diff --git a/sde_indexing_helper/static/js/delta_url_list.js b/sde_indexing_helper/static/js/delta_url_list.js index fb214cc1..2341b1e9 100644 --- a/sde_indexing_helper/static/js/delta_url_list.js +++ b/sde_indexing_helper/static/js/delta_url_list.js @@ -1208,12 +1208,22 @@ function getCuratedScrapedTitleColumn() { }; } +function escapeHtml(str) { + if (!str) return ''; + return str + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); +} + function getGeneratedTitleColumn() { return { data: "generated_title", width: "20%", render: function (data, type, row) { - return ``; @@ -1226,7 +1236,7 @@ function getCuratedGeneratedTitleColumn() { data: "generated_title", width: "20%", render: function (data, type, row) { - return ``;