[#181] fix search result data-name issues ( purging html only for data-name attribute, update op-list checkmarks accordingly )

This commit is contained in:
Robin Scholtes 2023-04-27 21:13:14 +12:00
parent bc93969d4b
commit c6cc998100
4 changed files with 7 additions and 6 deletions

View file

@ -46,8 +46,11 @@ class HTMLOperation {
* @returns {string}
*/
toStubHtml(removeIcon) {
console.log("toStubHtml ==>",this.name);
let html = `<li data-name="${this.name}" class="operation"`;
// this.name is pollute with HTML if it originates from search-results, so before
// returning the HTML we purge this.name from any HTML for the data-name attribute
const name = this.name.replace(/(<([^>]+)>)/ig, "");
let html = `<li data-name="${name}" class="operation"`;
if (this.description) {
const infoLink = this.infoURL ? `<hr>${titleFromWikiLink(this.infoURL)}` : "";