deathau / markdownload

A Firefox and Google Chrome extension to clip websites and download them into a readable markdown file.
Apache License 2.0
2.91k stars 226 forks source link

Strip "smart quotes" #346

Open JamoCA opened 2 months ago

JamoCA commented 2 months ago

Could a configuration option be added to automatically sanitize smart quotes?

I believe that you could use something like this:

str = str.replace( /\u2018|\u2019|\u201A|\uFFFD/g, "'" );
str = s.replace( /\u201c|\u201d|\u201e/g, '"' );
JamoCA commented 2 months ago

Perhaps an option to remove non-breaking spaces too.

stry = str.replace(/[\u02DC|\u00A0]/g, " ");

NOTE: I prefer using ASCII7 as much as possible.