Currently tackling a problem.
In my possession is a string that essentially consists of HTML code:
let htmlTitle = "<a href="/news/sky-sport-hd-in-italia-dal-18-novembr">Sky Sport HD in italia dal 18 novembre</a> | <a href="/news/ecco-il-genio-spagnolo-designer-di-moto-elettriche">News</a> | <a href="/news/lg-electronic-e-here-insieme-per-l-auto-connessa-e-autonoma">News</a>"
This particular string is sourced from my database.
Within my Vue app, there is an input field labeled "slug", containing the following snippet:
"sky-sport-hd-in-italia-dal-18-novembr"
essentially representing the permalink for the initial item referenced in the string.
Upon modifying the input field value, I require the title string to dynamically adjust accordingly. However, the method eludes me.
The title string may include numerous anchor tags, and I specifically aim to update only the href
attribute linked to the slug.
Hence, what's needed is something akin to this:
"<a href="{{ slug }}">Sky Sport HD in italia dal 18 novembre</a> | <a href="/news/ecco-il-genio-spagnolo-designer-di-moto-elettriche">News</a> | <a href="/news/lg-electronic-e-here-insieme-per-l-auto-connessa-e-autonoma">News</a>"
A computed value can indeed be employed, but bear in mind that the string might undergo modifications through a Wysiwyg editor, where titles like 'Sky Sport HD in italia dal 18 novembre' or 'News' are altered. The primary focus remains on retaining alignment with the slug...