jscreole icon indicating copy to clipboard operation
jscreole copied to clipboard

Add a function that just returns a string

Open Wilfred opened this issue 12 years ago • 1 comments
trafficstars

I don't always want to write to the DOM straight away, so it would be nice if jscreole provided a function that just returned a string. I'm currently doing:

function creoleToHtml(creoleSource) {
    var parser = new creole({
        linkFormat: '#'
    });

    var div = document.createElement('div');
    parser.parse(div, creoleSource);

    return div.innerHTML;
}

but this would probably be cleaner inside jscrole.

Wilfred avatar Dec 01 '12 17:12 Wilfred

Thanks, your point is well taken. I'll try to find time for this improvement.

codeholic avatar Dec 03 '12 15:12 codeholic