misc.search: parse html entities and encode URI for urls
This commit is contained in:
parent
6968680899
commit
4c78116cea
1 changed files with 4 additions and 4 deletions
|
@ -573,11 +573,11 @@ search.callback = async function (msg, line, args, {results = 2}) {
|
|||
let out = `__**Results for \`${safeString(line)}\`**__\n`;
|
||||
for (const result of searchResults) {
|
||||
if (result.special_response) {
|
||||
out += "> " + result.special_response.response.split("\n").join("\n> ");
|
||||
out += `\n<${result.special_response.source}>`;
|
||||
out += "> " + parseHtmlEntities(result.special_response.response.split("\n").join("\n> "));
|
||||
out += `\n<${encodeURI(result.special_response.source)}>`;
|
||||
} else {
|
||||
out += `**${result.title}** - <${result.url}>`;
|
||||
out += `\n> ${result.description}`;
|
||||
out += `**${parseHtmlEntities(result.title)}** - <${encodeURI(result.url)}>`;
|
||||
out += `\n> ${parseHtmlEntities(result.description)}`;
|
||||
}
|
||||
out += "\n\n";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue