Any idea how to get the whole content/data in the wysiwyg using dataProcessor.dataFilter/htmlFilter method?
Code below is working, but only comment content is available without the comment tag (<!-- -->), so I can't replace the comment to the desired markup.
The element only contains INLINE:143702;w=240;h=240 but I need to access <!-- INLINE:143702;w=240;h=240 -->.
The reason why I'm doing this is for some reason we are saving the image in the db in a comment format <!-- INLINE:fileID;w=width;h=height -->. The problem now is when loading the editor (editing the article) the image is not showing which makes the content difficult to format.
afterInit: function (editor) { var dataProcessor = editor.dataProcessor; var dataFilter = dataProcessor && dataProcessor.dataFilter; if (dataFilter) { dataFilter.addRules({ comment: function (element) { that = Drupal.behaviors.inline_plugins; // Replace inline images with physical image. element = element.replace(new RegExp('<!-- INLINE:([0-9]*);w=([0-9]*);h=([0-9]*) -->', 'gi'), function($0, $1, $2, $3) { return that._getPlaceholder($1, $2, $3); }); return element; //<!-- <img src=123 /> --> should be <img src=123 /> } }); } }