The My Opera forums have been replaced with forums.opera.com. Please head over there to discuss Opera's products and features

See the new Forums

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

7. December 2011, 07:18:06

JeroenH

Posts: 434

Markuper broken in 11.60?

It looks like Markuper was broken in 11.60:

[12/07/2011 08:15:29 AM] JavaScript - widget://wuid-00e8c4a5-e31e-0bb6-00b6-2e12e31e6b51/index.html
Event thread: _request
Uncaught exception: DOMException: NO_MODIFICATION_ALLOWED_ERR
Error thrown at line 187, column 12 in <anonymous function>(ev) in widget://wuid-00e8c4a5-e31e-0bb6-00b6-2e12e31e6b51/http.js:
    throw err;
called from line 297, column 16 in <anonymous function: handleRequest>(ev) in widget://wuid-00e8c4a5-e31e-0bb6-00b6-2e12e31e6b51/http.js:
    router.indexHandler(ev);
called from line 319, column 8 in <anonymous function: handleEvent>(ev) in widget://wuid-00e8c4a5-e31e-0bb6-00b6-2e12e31e6b51/http.js:
    router.handleRequest(ev);
Error initially occurred at line 63, column 8 in <anonymous function: parseFromString>(html) in mountpoint://application/lib/markuper.js:
    doc.documentElement.outerHTML = html;
called from line 1044, column 16 in open(path, isText) in mountpoint://application/lib/markuper.js:
    _template = markuper.HTMLHelper.parseFromString( _html );
called from line 981, column 12 in init(path) in mountpoint://application/lib/markuper.js:
    var success = open( path, _options.isText );
called from line 1866, column 4 in <anonymous function: markuper.Template>(path, _data, options) in mountpoint://application/lib/markuper.js:
    init( path );
called from line 9, column 4 in DefaultTemplate(name, data) in mountpoint://application/lib/templates.js:
    var template = new Markuper("templates/main.html", data);
called from line 55, column 8 in <anonymous function: GET>(request, response, unite) in mountpoint://application/app/controllers.js:
    var template = new DefaultTemplate("templates/log/range.html", data);
called from line 168, column 20 in <anonymous function>(ev) in widget://wuid-00e8c4a5-e31e-0bb6-00b6-2e12e31e6b51/http.js:
    resource[method](request, response, uniteData);
called from line 297, column 16 in <anonymous function: handleRequest>(ev) in widget://wuid-00e8c4a5-e31e-0bb6-00b6-2e12e31e6b51/http.js:
    router.indexHandler(ev);
called from line 319, column 8 in <anonymous function: handleEvent>(ev) in widget://wuid-00e8c4a5-e31e-0bb6-00b6-2e12e31e6b51/http.js:
    router.handleRequest(ev);
called from unknown location in program code:
    /* no source available */


Does anyone know a quick solution?

7. December 2011, 07:58:30

JeroenH

Posts: 434

They updated markuper in their own services, but forgot to increase the version number and did not push it to github...

This is the relevant code section:
    doctypeRegexp: /<!DOCTYPE(("|')[^\2]*\2|[^"'>])*>/i,
    defaultDoctype: '<!doctype html>',
    // HINT: change it to use Resig's html parser (adapt it to use DocumentFragment?)
    //       http://smallr.net/htmlparser
    /**
     * Constructs an DOM document given an html string
     *
     * @param   {String}    html    The HTML string.
     * @returns {DOM} The DOM document constructed from the html string given.
     */
    parseFromString: function( html )
    {
        var doc = document.implementation.createHTMLDocument('');
        var doctype = (html.match(this.doctypeRegexp)||[this.defaultDoctype])[0];
        
        // HACK: do this so it's possible to load plain text
        if ( html[0] != '<' ) { html = '<body>' + html + '</body>' };
        
        doc.documentElement.innerHTML = html;
        doc._doctype = doctype;
        return doc;
    },

Forums » Dev.Opera » Archived Opera Unite Development Discussions