guardian / scribe

DEPRECATED: A rich text editor framework for the web platform
http://guardian.github.io/scribe/
Apache License 2.0
3.51k stars 245 forks source link

Seeing em.scribe-marker tags during "normalize" #460

Open mindplay-dk opened 8 years ago

mindplay-dk commented 8 years ago

I have a simple plugin along the lines of:

define(function () {

    return function() {

        /**
         * @param {Node} node
         */
        function sanitize(node) {
            // ...
        }

        return function (scribe) {
            scribe.registerHTMLFormatter('normalize', function (html) {
                if (typeof html === 'string') {
                    var node = document.createElement('div');

                    node.innerHTML = html;

                    sanitize(node);

                    return node.innerHTML;
                } else {
                    sanitize(html);

                    return html
                }
            });
        };
    };

});

While visiting every node recursively, I seem to encounter the <em class="scribe-marker"> tags.

Should that be happening?