Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a function that just returns a string #4

Open
Wilfred opened this issue Dec 1, 2012 · 1 comment
Open

Add a function that just returns a string #4

Wilfred opened this issue Dec 1, 2012 · 1 comment
Assignees

Comments

@Wilfred
Copy link

Wilfred commented Dec 1, 2012

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.

@ghost ghost assigned codeholic Dec 3, 2012
@codeholic
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants