question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to deal with HTML entities in page titles?

See original GitHub issue

My page titles are coming from Wordpress and some contain HTML entities (like –).

How can I convert this inside NextSEO config? Normally I would use dangerouslySetInnerHtml, but I don’t think that syntax would work inside the config.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
garmeehcommented, Jul 10, 2019

Hey @geochanto, I would say what you could do is call a function for the title that returns the html. Haven’t tried it but should work. It might look something like:

getTitle(title) {
    return {
      __html: `${title}`,
    };
  }
config={{
  title: this.getTitle(this.props.title)
}}
0reactions
IlirBajramicommented, May 3, 2022

I need a solution for thi one too. any news?

Read more comments on GitHub >

github_iconTop Results From Across the Web

é HTML Entity code in title tags - Stack Overflow
I'm trying to use the HTML entity code for 'é' in the title tags of my site, and it doesn't seem to be...
Read more >
The Document Title element - HTML - MDN Web Docs - Mozilla
The <title> HTML element defines the document's title that is shown in a browser's title bar or a page's tab. It only contains...
Read more >
Document How to Handle/Return HTML Entities in Title ...
Document How to Handle/Return HTML Entities in Title Callbacks · Problem/Motivation · Proposed resolution · Remaining tasks · User interface changes.
Read more >
HTML Entities - W3Schools
HTML Entities ... Reserved characters in HTML must be replaced with character entities. HTML Entities. Some characters are reserved in HTML. If you...
Read more >
Dealing with HTML Entities - WordPress.org
When I add a test post into my local dev install, using an ampersand character in the title, I do not experience that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found