Ticket #709 (closed enhancement: fixed)

Opened 7 years ago

Last modified 7 years ago

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

Changed 7 years ago by anonymous

  • severity changed from normal to enhancement

Changed 7 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?

Changed 7 years ago by gogo

  • status changed from new to closed
  • resolution set to fixed

Added a filter in changeset:507

Note: See TracTickets for help on using tickets.