-Circuito Italia raddoppiato sulle Attività
This commit is contained in:
@@ -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) {
|
async getAnnuncioForTelegram(myrec, tablerec, mydescr, userorig, nuovo) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -4614,7 +4632,9 @@ module.exports = {
|
|||||||
if (cat)
|
if (cat)
|
||||||
out += this.addRowTelegram('⭐️', 'Categoria', cat, true);
|
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)
|
if (descrcontent)
|
||||||
out += this.addRowTelegram('📝', 'Descrizione ' + newdescr, descrcontent, true);
|
out += this.addRowTelegram('📝', 'Descrizione ' + newdescr, descrcontent, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user