jscreole
jscreole copied to clipboard
Add a function that just returns a string
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.
Thanks, your point is well taken. I'll try to find time for this improvement.