Page 1 of 1

Is there a way to get "curly" quote marks in my text blocks automatically

Posted: Sun Feb 05, 2006 7:12 am
by thetallguy
I noticed that a lot of my site text has straight quote marks (") in it.  (This is what happens when one uses a straight text editor to create the site text, I guess. :)

Does anyone know a setting in Apache, PHP or CMSMS that will automatically convert these straight quotes into the typographically better open and close quotes?

(This seems like a stretch, but I'm really not excited about manually converting all the text on my site!)

Thanks!
Michael

Re: Is there a way to get "curly" quote marks in my text blocks automatically

Posted: Sun Feb 05, 2006 6:10 pm
by thetallguy
Hey, now THAT'S cool!  I'll check it out.

Thanks!
Michael

Re: Is there a way to get "curly" quote marks in my text blocks automatically

Posted: Mon Feb 06, 2006 11:48 pm
by jelle
With replacing alone you won't get what you want, as you probably want to emulate the 'smart quotes' as done by word et al. They replace pairs of straight quotes with a opening and qlosing quote. Tha tis two different characters. Maybe you are better served with a css solution to put your required chars before and after a ?
You can do that with the :before and :after pseudo classes like:

Code: Select all

cite:before {
    content: "\"";
    }
Not really sure how you can get the correct char to show up (check with a different codepage!) but you should be able to figure it out from here. 

Re: Is there a way to get "curly" quote marks in my text blocks automatically

Posted: Tue Feb 07, 2006 2:32 am
by thetallguy
Thanks, Jelle!  The CSS trick is useful, but won't solve this particular problem, since I'm talking about the quotes that are embedded in the normal page text all over the place.  (Like the quotes I'm using here: "Smart Quotes".)  I'd forgotten about the :before and :after pseudo-classes, though, which I can use elsewhere on the site.

Michael

Re: Is there a way to get "curly" quote marks in my text blocks automatically

Posted: Tue Feb 07, 2006 9:10 am
by jelle
Yes, that is true, if your text has already been entered and you do not want to edit it then adapting the display of  <cite> won't work. But replacing straight quotes with the correct curly one will be very hard too. Not evry opening quote will be matched by a closing quote. If you do not take any precautions against that and use some sort of counting scheme, you might end up closing a quote where the user intended to open it.
On the other hand, that is not the end of the world.