(function runPrismPreprocessor() {

    /* Process all <code> elements */
    var codeElements = $('pre > code[class*=lang-], pre > code[class*=language-]'); // All code elements with class language-* or lang-*
    if (codeElements.length) {
        codeElements.each(processCodeElement);
    };

    /* Process a <code> element */
    function processCodeElement() {
        var code = $(this);
        var pre = code.parent();

        processClass(code);
        processLineNumbers(code, pre);
        processDataStart(code, pre);
        processDataLine(code, pre);
        processDataLineOffset(code, pre);
    }

    /**
     * Apparently, Ghost removes everything after the first space in <code>'s class attribute.
     * As a workaround, I use "." as a separator in Markdown and replace it with spaces here.
     */
    function processClass(code) {
        code.attr('class', code.attr('class').replace(/\./g, " "));
    }

    /* Process line-numbers */
    function processLineNumbers(code, pre) {
        moveToPreClass("line-numbers", code, pre);
    }

    /* Process data-start */
    function processDataStart(code, pre) {
        moveToPreAttr(/(data-start)="([0-9]+)"/, code, pre);
    }

    /* Process data-line */
    function processDataLine(code, pre) {
        moveToPreAttr(/(data-line)="(([0-9]|-|,)+)"/, code, pre);
    }

    /* Process data-line-offset */
    function processDataLineOffset(code, pre) {
        moveToPreAttr(/(data-line-offset)="([0-9]+)"/, code, pre);
    }

    /* Removes a class from <code> and adds it to <pre> */
    function moveToPreClass(clazz, code, pre) {
        if (code.attr('class').indexOf(clazz) >= 0) {
            code.attr('class', code.attr('class').replace(clazz, ""));
            pre.addClass(clazz);
        }
    }

    /* Moves an attribute from <code> class to <pre> attribute */
    function moveToPreAttr(regex, code, pre) {
        var match = code.attr('class').match(regex);
        if (match) {
            var attr = match[1]; // Make sure regex sets this!!
            var value = match[2]; // Make sure regex sets this!!
            code.attr('class', code.attr('class').replace(regex, ""));
            pre.attr(attr, value);
        }
    }

})();

@@ -597,32 +597,67 @@
 set(code, pre);%0A
+        processDataSrc(code, pre);%0A
     %7D%0A%0A    /**%0A 
@@ -781,17 +781,17 @@
  I use %22
-.
+%7C
 %22 as a s
@@ -942,17 +942,17 @@
 place(/%5C
-.
+%7C
 /g, %22 %22)
@@ -1201,30 +1201,27 @@
 ta-start)=%22(
-%5B0-9%5D+
+.+?
 )%22/, code, p
@@ -1343,20 +1343,11 @@
 )=%22(
-(%5B0-9%5D%7C-%7C,)+
+.+?
 )%22/,
@@ -1497,14 +1497,142 @@
 )=%22(
-%5B0-9%5D+
+.+?)%22/, code, pre);%0A    %7D%0A%0A    /* Process data-src */%0A    function processDataSrc(code, pre) %7B%0A        moveToPreAttr(/(data-src)=%22(.+?
 )%22/,

Add markdown support for File Highlight