Opened 12 years ago

Closed 12 years ago

#709 closed enhancement (fixed)

Remove Smart Quotes from Word Formatting

Reported by: umbrae@… Owned by: gogo
Priority: normal Milestone:
Component: Plugin_SuperClean Version: trunk
Severity: normal Keywords: smart, quotes, word, microsoft
Cc:

Description

I've found that smart quotes are not formatted for the web with SuperClean. I've included the following code into super-clean.js to clean out smart quotes:
(note: I'm unfortunately aware that this is not the right place for this code. However, I could not get it to work under _wordClean for some reason)

I put the following into SuperClean.filterFunctions.remove_colors:

  D = D.replace(String.fromCharCode(8216),"'");
  D = D.replace(String.fromCharCode(8217),"'");
  D = D.replace(String.fromCharCode(8220),"\"");
  D = D.replace(String.fromCharCode(8221),"\"");

If anyone would like to figure out where this chunk of code should -actually- go and commit it, I think this would be an excellent addition to xinha - this is one of my main complaints with web text editors.

Change History (3)

comment:1 Changed 12 years ago by anonymous

  • Severity changed from normal to enhancement

comment:2 Changed 12 years ago by umbrae@…

Already found one problem. Only changes 1 character.

use this instead:

  D = D.replace(new RegExp(String.fromCharCode(8216),"g"),"'");
  D = D.replace(new RegExp(String.fromCharCode(8217),"g"),"'");
  D = D.replace(new RegExp(String.fromCharCode(8220),"g"),"\"");
  D = D.replace(new RegExp(String.fromCharCode(8221),"g"),"\"");

I'll admit I'm not aware of the intricacies of javascript and garbage collection or whathaveyou - this doesn't cause a memory leak, does it?

comment:3 Changed 12 years ago by gogo

  • Resolution set to fixed
  • Status changed from new to closed

Added a filter in changeset:507

Note: See TracTickets for help on using tickets.