i have a doubt that i can not resolve.
I have this data, that i received:
const groupedElements = [
{
_id: 'OVTBLNCDYBHP3IKUFQLGQF6AC4',
type: 'text',
additional_properties: { tag: 'p' },
alignment: 'center',
content: '<strong>A 24 horas de que tenga lugar la boda entre el jugador del FC Barcelona Lionel Messi y su pareja Antonella Rocuzzo se ha sabido que un ex jugador del Real Madrid está invitado al enlace.</strong>'
},
{
_id: 'MJQIUVGPPJCSDGYDUFE6SIMB6U',
type: 'text',
additional_properties: { tag: 'p' },
alignment: 'center',
content: 'Entre los <a href="http://as.com/tikitakas/2017/06/26/portada/1498509190_687200.html" target="_blank">260 invitados a la celebración </a>
está, cómo no, toda la plantilla del Barça y algunos ex jugadores azulgranas como Ronaldinho, Xavi, Cesc Fábregas o Deco, además de otras grandes figuras del fútbol mundial como Lavezzi y Agüero.'
},
{
_id: '5HL7OES5BJDQPEVVMX3DH4D5AE',
type: 'text',
additional_properties: { tag: 'p' },
alignment: 'center',
content: 'Desde Diez, sin embargo, informan que estas no serían todas las caras conocidas que acudirán a la mediática boda,
que contará con <a href="http://as.com/tikitakas/2017/06/28/portada/1498634766_750691.html" target="_parent">todo tipo de comodidades para los invitados.</a> <strong>Un ex madridista estaría,
según la publicación, invitado al enlace y no sería otro que Ángel Di Maria.</strong>'
},
{
_id: 'RBVQCVJDRZGS3OVHO3WW5FITKU',
type: 'text',
additional_properties: { tag: 'p' },
alignment: 'center',
content: 'El jugador del París Saint-Germain de la Ligue 1 de Francia y el delantero del FC Barcelona son compañeros en la Selección Argentina<strong>, </strong>por lo que esta información parece bastante lógica.'
},
]
I need to access to content property and find if there is some attribute 'target' inside and if this is equal to _parent, remove it.
I tried to to this, first to locate the attribute inside content, but i can not achieve:
const newGroupElements = groupedElements.map(element =>
element.content.includes("_parent") ? {...element, content: 'i found you'} : element)
Thanks for your light in my knowledge.
contenton match?