Ticket #134 (assigned defect)
removeEmptyTags - removes content
| Reported by: | straka | Owned by: | jf.hovinne |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.6 |
| Component: | Editor | Version: | trunk |
| Keywords: | removeEmptyTags, text corruption | Cc: |
Description
We have some really not great RTF files, which we are importing using copy/paste to wymeditor.
There is non-breakable space after preposition, and because the RTF files are not very good (export from QuarkPress) it sometimes produces (it's visible for example in OpenOffice toolbar that the space is really in italics)
z<em> </em>test
and the whole non-breakable space is removed by removeEmptyTags resulting into:
ztest
(so the space is removed) resulting into broken text. If I understand it correctly the removeEmptyTags method should remove tags which are "around" white space and thus are not necessary. So imho it should be:
return xhtml.replace(new RegExp('<('+this.block_tags.join("|")+')>(<br \/>| | |\\s)*<\/\\1>' ,'g'),'$2');
istead of:
return xhtml.replace(new RegExp('<('+this.block_tags.join("|")+')>(<br \/>| | |\\s)*<\/\\1>' ,'g'),);