Support » Plugin: Developer Formatter » Tag DVFMTSC remaing in formated code

  • Since I started using DevFormater I’ve been running into a problem that sometimes, just randomly, a HTML comment tag “<!–DVFMTSC–>” appeared inside the formated CODE tag.

    First it was so rare I was able to remove them manually, but today I ended with a post containing thousands of “<!–DVFMTSC–>” and even “<!−−DVFMTSC−−>”.

    So I had to take and action and I’ve created a function to permanently remove them from the posts.

    function fixDVFMTSC(text) {
    	var newText = text;
    	text = '';
    
    	while (newText !== text) {
    		text = newText;
    		newText = text.replace(new RegExp('(<|<)!(-|−){2}DVFMTSC(-|−){2}(>|>)', 'g'), '');
    	}
    
    	return newText;
    }

    Then I’ve used thim method in file “\wp-content\plugins\devformatter\devfmt_editor.js” in function “this.parseEnd” changing line
    return a1 + block + a4;
    to
    return a1 + fixDVFMTSC(block) + a4;

    So if anyone runs into a similar problem, this may be the workaround.

    But still does anyone know the real reason why this happens?

    https://wordpress.org/plugins/devformatter/

Viewing 1 replies (of 1 total)
  • I try it use your fixDVFMTSC function inside and outside (devfmt_EditorCtrl = function(Editor)), but dont work for me. 🙁

    where you put this function?

Viewing 1 replies (of 1 total)
  • The topic ‘Tag DVFMTSC remaing in formated code’ is closed to new replies.