bootstrap-wysiwyg / bootstrap3-wysiwyg

Simple, beautiful wysiwyg editor
http://bootstrap-wysiwyg.github.io/bootstrap3-wysiwyg/
MIT License
834 stars 264 forks source link

adding styles on parse #127

Open ryan2johnson9 opened 9 years ago

ryan2johnson9 commented 9 years ago

Is it possible through a configuration option to add inline styles for elements which have 'wysiwyg-' classes added to them.

e.g.

in the iframe I have

<div class='wysiwyg-text-align-right'>someText</div>

and when it is parsed into the textarea I'd like to get

<div class='wysiwyg-text-align-right' style='text-align:right;'>someText</div>

currently I am doing this elsewhere on my server side which is not very elegant.

I see in the source code in the _handleAttributes method a line:

addStyle = rule.add_style, // add styles based on existing attributes

which if true later allows the calling of the method

addStyleMethods

However, I do not know if that method does what I am asking, or how to add the rule to addStyles.