Ticket #134 (assigned defect)
removeEmptyTags - removes content
Reported by: | straka | Owned by: | jf.hovinne |
---|---|---|---|
Priority: | minor | Milestone: | 2.0 |
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'),);
Your proposal doesn't seem to be an option since cases like:
Will output:
Instead of:
I don't see any solution ATM, since your issue is quite specific (you could override the removeEmptyTags function, but it's not ideal).
FYI we'll improve the events architecture in the next version, so it'll be possible to hook custom code into e.g. the copy/paste logic.