Skip to content

Add a function that just returns a string #4

Open
@Wilfred

Description

@Wilfred

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions