I am currently working on an application that retrieves data from an API and displays it. However, I have run into a slight issue where some of the data includes markdown for italicizing text, like this:
[
{
"t": "a {it}dog{/it} who needs a loving home"
}
]
For the front end, I am using EJS templating language to render the data as follows:
<% if(sense[0][1].dt[1]){
const example = sense[0][1].dt[1][1][0].t; %>
<div class="col-12 sense-example-wrapper">
<p class="sense-example"><%= example %></p>
</div>
<% } %>
The content within {it} curly braces in the JSON data is stored in the variable <%= example %>
I am facing a challenge in styling the {it}dog{/it} (and all other occurrences of that markdown) as italic using CSS, but I am unsure how to achieve this. Despite my efforts to find a solution online, I have not been successful.
Thank you for your assistance.
P.S.: Please excuse any confusion in my explanation, as I am still relatively new to programming.