Forum OpenACS Development: Best practices for "Smart Quotes"?

Collapse
Posted by Dave Bauer on
What are the most recent best practices for handling Microsoft Word Smart Quotes pasted into a textarea?
Collapse
Posted by Brian Fenton on
Hi Dave

we ran into some problems with HTMLarea when replacing the smart quotes with the HTML entity 8217, so just ended up doing this:

set microsoft_apostrophe \u2019
regsub -all $microsoft_apostrophe $letter "'" letter

hope this helps
Brian

Collapse
Posted by Gustaf Neumann on
you mean, pasted into plain textarea, or pasted into a richtext widget? For the latter one, we switched a while ago to ckedit, which works nice and supports mobile devices. it has a paste from word, and also vice versa, an extra plugin for creating smart quotes while you are typing in the text area.

In general, tidy is still very helpful to clean up wierd input. e.g. "tidy ... -b ..." strips smart quotes and em-dashes.

Collapse
Posted by Dave Bauer on
Thanks,

I do recall now I have used Tidy before. Can I just call it from a shell script? Is that the easiest way. It shouldn't be called that much as there are not that many editors in this application.

Collapse
Posted by Gustaf Neumann on
Dave, have a look at xowiki-utility-procs.tcl [1]. it contains a function callable like in:
 set cleanText [::xowiki::tidy clean $text]
it should be straightforward to modify this for your needs.

-g
[1] xowiki::tidy

Collapse
Posted by Neophytos Demetriou on
I have uploaded a version of a (modified) critcl-based htmltidy library. It's been a while. Just making it available for anyone who cares. If you need further info please do not hesitate to contact me. Here's the link:
https://openacs.org/storage/download/htmltidy.tar.bz2?file_id=4230928
Collapse
Posted by Brian Fenton on
Hey Neophytos! Long time no see. Good to have you around again.

Brian

Collapse
Posted by Neophytos Demetriou on
Hi Brian, I've been keeping myself busy with all sorts of stuff. Glad to be around again and I hope we'll get a chance to meet again in the near future.
Collapse
Posted by Brian Fenton on
I'll look forward to it.