sbenhaim / protobrew

Meteor.js wiki engine
4 stars 4 forks source link

redactor bug?: empty line breaks are stripped in save #116

Closed funkyeah closed 10 years ago

funkyeah commented 10 years ago

Reproduce: goto: http://imperavi.com/redactor/ insert a few nested


by hitting "enter" in the redactor area open console do: $('#redactor').redactor('get') returned value will not have the


for the inserted blank lines that do show up in the redactor area

Is this a bug? Is there a way of getting those empty elements so that my saved content can be reopened without the empty elements removed?

funkyeah commented 10 years ago

submitted bug report to redactor team

funkyeah commented 10 years ago

after a couple circles with the redactor team I found out a couple things:

the set-removeEmptyTags needs to be set to false in order to prevent outright stripping of tags when getting content from redactor... with that unset, a


that normally was removed is now provided as just the

with the
stripped

next, if you put

in a textarea and then initialize redactor on that textarea (like we were doing) redactor will strip all empty tags even with the set-removeEmptyTags set to false

the correct approach is to use the redactor API set method with the cleanTags set to false

a6e18c46ff2e17f16786e52d8f810ed6963dcc53