I want to transform all text within curly brackets into a link using CSS selectors. I could write it in JavaScript, but I’m wondering whether it can be added in CSS like this:
p:before {
content: "<a href'http://example.com/t2'>";
}
p:after {
content: "</a>";
}
The t2 in the href would be a copy of the text inside the curly brackets.
In the example above all of the text inside the p is transformed into a link, but is there a way to select only stuff inside curly braces?
It’s generally a good idea to use Javascript for this kind of thing.
CSS is best suited for manipulating presentational aspects of your page.
What you’re trying to do here is to manipulate the page content, for which Javascript is just the thing.