After successfully integrating the WordPress API with a Nuxt-based website, I encountered an issue when trying to display blog post titles fetched from WordPress. The code snippet below is used for this purpose:
head() {
return{
title: this.post.title.rendered
}
}
The problem arises when special characters such as single quotes are included in the title. These characters appear as they are inside the <title>
tag. For example:
original text : Let’s begin
text to render : Let's begin
rendered output : Let’s begin
While using <v-html>
would work if displaying the content on a page, it does not solve the issue when trying to include the same content inside the title tag. How can this be achieved?