Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#39 Curly quotes

Tobin Juday

I propose that the substitution of curly quotes and dashes into their regular ASCII versions be driven only by the asciiChars property. Currently, here is the if statement for running the substitution:

if (this.configuration.makeClean && this.configuration.asciiChars || this.configuration.makeBare)

I'm in the situation where I want to clean Word html (and so makeBare is true), but I want to leave in the curly quotes (because my html parser can handle them). Currently, there's no way I can do that.

I would like the line to read:

if (this.configuration.makeClean && this.configuration.asciiChars || this.configuration.makeBare && this.configuration.asciiChars)

This would allow me to use makeBare (and makeClean), and still keep my curly quotes by setting asciiChars to false.

I understand that this would break users who are using makeBare and counting on the curly quote substitution. To keep that old behavior, we could also add a new field, something like keepSpecialChars. In that case, the line would now look something like:

if (this.configuration.makeClean && this.configuration.asciiChars || this.configuration.makeBare && !this.configuration.keepSpecialChars)

However, it seems sort of silly to add a new property when we've already got the asciiChars property for exactly this reason. Basically, I just need to be able to clean Word html, but keep curly quotes. I don't really care how it's implemented.



  • aditsu

    Hi, are you able to achieve this using Tidy (the C program)? Or does it behave the same way?
    As far as I can tell, it has the same condition.

  • Tobin Juday
    Tobin Juday

    We have not tried the C version. We ended up just running our own hacked version of jtidy.