• Hello,

    I’m using Crayon Syntax Highlighter plug in but it only displayes 2 lines of code and it cleans the code before it displays anything. I was hoping it would just display want i enter into the crayon window.

    example entire into the crayon window:
    <html>
    <header>
    <title> OpenEgg – Single select dropdown list box using HTML </title>
    </header>
    <body>
    <select name=”selectcountry”>
    <option>Canada</option>
    <option>Mexico</option>
    <option >United States</option>
    </select>
    </body>
    </html>

    after saving the information i get the following:
    header>OpenEgg – Single select dropdown list box using HTML</header>
    <select name=””selectcountry””> <option>Canada</option> <option>Mexico</option> <option>United States</opt

    any idea why its only displaying the out put in 2 lines and at the same time why is it cleaning the code out.

    I’m new so any help you can provide would be greatly appreciated

Viewing 4 replies - 1 through 4 (of 4 total)
  • Well spotted, fixing.

    Well that was easy. It turns out that adding in unencoded tags in the visual editor causes them to be added as real tags (so an input will become a real input, but only in the visual editor, it won’t be an input on the post…). I fixed it by specifying ‘encode’ on the output in my function ??

    ed.addCommand('showCrayon', function() {
    	te.showDialog(
        	function(shortcode) {
        		ed.execCommand('mceInsertContent', 0, shortcode);
        	},
        	function(shortcode) {
        		// This will change the currPre object
        		var newPre = jQuery(shortcode);
        		jQuery(currPre).replaceWith(newPre);
        		// XXX DOM element not jQuery
        		currPre = newPre[0];
        	}, 'tinymce', ed, currPre, 'decode', 'encode');
    
    	if (!currPre) {
    		// If no pre is selected, then button highlight depends on if it's used
    		me.setHighlight(!s.used);
    	}
    });

    Let me know if this works for you so everyone else can have a slice of the cake:

    https://dl.dropbox.com/u/33811812/Crayon/crayon-syntax-highlighter-1.9.2-1.zip

    You can just upload “/util/tag-editor/crayon_te.js” nothing else was changed.

    Thread Starter openword

    (@openword)

    Hello Akarmenia,

    I upload “/util/tag-editor/crayon_te.js and it seem to have fixed the problem. I only uploaded just that one file nothing else.

    Google Chrome version 18.0.1025.151m Works
    FireFox version 11.0 Works

    IE version 8.0.6001.18702 works but not consistent with the other 2 browsers:
    – Line numbers aren’t appearing.
    – Every other line in Firefox and Chrom is shaded but not in IE 8.
    Either case, its not a deal breaker and its readable.

    Thanks for the help,
    cheers

    Cool, I’ve got others on IE 8 having a few issues so I’ll look into that.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Plugin: Crayon Syntax Highlighter’ is closed to new replies.