Thanks for the extra pair of eyes @coalmay, looks like the editor I was using has an encoding bug which was resulting in the strange double quote character.
I changed the file extension of the file I was editing from .ejs to .js and the double quotes started looking normal again.
Very annoying, but at least there is a workaround until the bug is fixed.
Thanks also for the HTML snippet you posted. I was using the recommendation from w3schools, looks like they were wrong in this case:
If you paste the snippet from w3Schools into the W3C’s validator you will see it produces 1 warning (pertaining to the missing lang attribute), and 1 error (pertaining to the missing title element) which is a required element.
In certain circumstances, it is permitted to omit the head tag (see The HTML Spec) as it is with the title element.
As a fun little note this HTML is valid (according to the validator)
Thanks - I heard back from the devs of my editor. Turns out it was a feature.
There are 2 modes:
natural
programming
In natural mode, where there is autocorrect and auto capitalisation, you get the weird double quotes. Setting the file to ‘programming’ mode gets you the double quotes that browsers understand.
I mention it here in case it helps someone else with similar issues.