Quote:
Originally Posted by signum
If you decide to proceed, I have some tiny corrections that enable smoothRemove to deal with < b >, < blockquote > and < i > correctly. As it stands, the "bold" tag doesn't get closed and blockquote is just deleted entirely. I forget what's wrong with the "italic" tag. I'll be watching my inbox here at least once a day.
|
IMHO, the plugin author took some shortcuts and missed at least one typo. The relevant code is:
Code:
self.OPENTAG = ['<p','<b','<i','<u','<h1','<h2','<h3','<h4','<h5','<h6','<ol','<ul','<li','<body']
The highlighted expression matches <b> tags, but also all other tags that start with a b, e.g. <blockquote>.
Code:
self.CLOSETAG = ['</p>','</b>','</i>','</u>','</h1>','</h2>','</h3>','</h4>','</h5>','</h6>','</ol>','</ul>','</li>','</body>','</html>']
The closing right angle bracket of </b> is missing.
IMHO, pretty much everything that this plugin does, can be achieved by a simple regex search:
Find:
<(p|b|i|u|h[1-6]|ol|ul|li|body) [^>]+>
Replace:
<\1>
(My regex search string isn't perfect either, but it's slightly more robust than the one used in the plugin code.)