tiff / wysihtml5

Open source rich text editor based on HTML5 and the progressive-enhancement approach. Uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inline styles.
http://xing.github.com/wysihtml5/
MIT License
6.49k stars 1k forks source link

Inline Style ?? #534

Open luis888 opened 9 years ago

luis888 commented 9 years ago

Hi, Fine job thank's, I need that users writing are readable by other programs that i cannot change, is there a way to get all styles inline without a need for CSS. best regards Luis

damien-biasotto commented 8 years ago

Better late than never :

This module is deprecated, obsolete and you better find an alternative but if you have no choice you can read below :

Unfortunately there are no proper way to this without editing core files … You need to had a new entry in attributeCheckMethods object : source: https://github.com/jaybee/wysihtml5/commit/9027cc0bdc73a3ef3ea66100bd528780aad7a630

style: (function() {
      var REG_EXP = /[^a-z0-9_\-]\:[^a-z0-9_\-];/gi;
      return function (attributeValue) {
        return attributeValue;
      };
    })()

And then you have to add the rule for tags needing inline style :

check_attributes: {
     "style": "style"
}