Is there a way to convert straight quotes to curly quotes on a page using CSS?
' = straight quote
“ = curly quote
if not, or javascript? Like is there a javascript that can convert all straight quotes on a page to curly quotes?
If not, how do we do so in php?
You can always use str_replace() if you can edit the php file. Just use the following syntax
str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ]);
ex: str_replace (' " ', ' ” ', $php_output);
This link talks about doing this in javascript. Note that this implementation does more than you're asking, so you'd want to modify it a bit.
In JS you can do it like that:
<script>
function replace(node) {
if (node.childNodes === undefined) {
return;
}
for (var i = 0, len = node.childNodes.length; i < len; ++i) {
var child = node.childNodes[i];
if (child.nodeType == 3) {
child.data = child.data.replace(/"/g, '“');
}
replace(child);
}
}
replace(document.body);
</script>
Probably you should modify this code in that way it'll close opened quote.
curly quotes are not the same characters as straight quotes.
Therefore as long as you actually type the curly quotes instead of the straight ones they will appear like that on your page.