Issue Bug Closed

#58310rtehtmlarea "remove format" eats too much (Patch included)

Volker Burggräf 04/29/14, 09:25 updated 10/02/18, 11:55

Description

The remove format function w/ msword selected removes too much content. This seems to affect all Versions of TYPO3 CMS 4.7 to 6.2.1!

File typo3/sysext/rtehtmlarea/htmlarea/plugins/RemoveFormat/remove-format.js, line 244-246:

// Remove unwanted tags and their contents: style, title
html = html.replace(/<style[^>]*>.*<\/style[^>]*>/gi, "").
replace(/<title[^>]*>.*<\/title[^>]*>/gi, "");

This removes too much content if more than one <style> block is found inside the content. <br />Patch:</p> <p>

// Remove unwanted tags and their contents: style, title
html = html.replace(/<style[^>]*>.*?<\/style[^>]*>/gi, "").
replace(/<title[^>]*>.*<\/title[^>]*>/gi, "");
</p> <p>(Added a Questionmark in the style regexp.)</p></style>

Reviews 1