/* porque este formato no funciona {"tags":["lofi","test"],"texto":"Lofi drum…
- User
/* porque este formato no funciona
{"tags":["lofi","test"],"texto":"Lofi drum loop","autor":{"id":"1","usuario":"1ndoryu","nombre":"Wandorius"},"bpm":150,"emotion":"","key":"Ab","scale":"major","descripcion_ia":{"es":"Loop de batería lofi con un ritmo relajado y repetitivo, ideal para la creación de beats hip hop o música electrónica con una estética vintage. Su sonido es cálido y orgánico, con un groove sutil que invita a la relajación. Perfecto para proyectos chillhop, lofi hip hop, o cualquier género que requiera un beat suave y atmosférico.","en":"Lofi drum loop with a relaxed and repetitive rhythm, ideal for creating hip hop beats or electronic music with a vintage aesthetic. Its sound is warm and organic, with a subtle groove that invites relaxation. Perfect for chillhop, lofi hip hop, or any genre that requires a smooth and atmospheric beat."},"instrumentos_posibles":{"es":[],"en":[]},"estado_animo":{"es":["Relajado","Tranquilo"],"en":["Relaxed","Calm"]},"artista_posible":{"es":["Nujabes","J Dilla","MF DOOM"],"en":["Nujabes","J Dilla","MF DOOM"]},"genero_posible":{"es":["Lofi hip hop","Chillhop","Hip hop instrumental"],"en":["Lofi hip hop","Chillhop","Hip hop instrumental"]},"tipo_audio":{"es":["Loop"],"en":["Loop"]},"tags_posibles":{"es":["Lofi","Hip Hop","Chillhop","Loop","Drums","Batería","Suave","Relax","Vintage","Warm"],"en":["Lofi","Hip Hop","Chillhop","Loop","Drums","Smooth","Relax","Vintage","Warm"]},"sugerencia_busqueda":{"es":["Beat lofi relajante","Loop de batería lofi","Música lofi para relajarse"],"en":["Relaxing lofi beat","Lofi drum loop","Relaxing lofi music"]}}
necesito que funcione sin dañar el resto de cosas */
function repararJson(jsonString) { try { jsonString = jsonString.replace(/"([^"]+?)":\s*?"({.*?})"/g, function (match, p1, p2) { return
"${p1}":"${p2.replace(/"/g, '\\"')}"; }); return JSON.parse(jsonString); } catch (e) { console.error('Error al parsear el JSON:', e.message); return null; } } function capitalize(word) { return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); }function removeDuplicates(arr) { return [...new Set(arr)]; }
function tagsPosts() { document.querySelectorAll('p[id-post-algoritmo]').forEach(function (pElement) { const postId = pElement.getAttribute('id-post-algoritmo'); const tagsContainer = document.getElementById('tags-' + postId);
code - Assistant