-Circuito Italia raddoppiato sulle Attività

This commit is contained in:
Surya Paolo
2024-02-28 11:37:29 +01:00
parent 4a980aaad2
commit da9d5f25ea

View File

@@ -4532,6 +4532,24 @@ module.exports = {
}
},
convertHTMLTagsToText(input) {
const tagMap = {
"<ul>": "",
"<ol>": "1. ",
"<li>": "\n- ",
"</ul>": "",
"</ol>": "",
"</li>": ""
};
// Replace supported HTML tags with their corresponding text representations
let output = input.replace(/<ul>|<ol>|<li>|<\/ul>|<\/ol>|<\/li>/g, (match) => {
return tagMap[match];
});
return output;
},
async getAnnuncioForTelegram(myrec, tablerec, mydescr, userorig, nuovo) {
try {
@@ -4614,7 +4632,9 @@ module.exports = {
if (cat)
out += this.addRowTelegram('⭐️', 'Categoria', cat, true);
let descrcontent = this.firstchars(this.removeLastSpaceAndACapo(myrec.note), 175, true, url);
let note = this.convertHTMLTagsToText(myrec.note)
let descrcontent = this.firstchars(this.removeLastSpaceAndACapo(note), 175, true, url);
if (descrcontent)
out += this.addRowTelegram('📝', 'Descrizione ' + newdescr, descrcontent, true);