empress / ember-cli-showdown

Ember component to render markdown into HTML.
https://empress.github.io/ember-cli-showdown/
MIT License
101 stars 35 forks source link

How to call makeHtml in component js action method #71

Closed SantoshRaoBlr closed 5 years ago

SantoshRaoBlr commented 5 years ago

After doing an import of showdown, import showdown from 'showdown'; I can call methods like showdown.setOption('literalMidWordUnderscores',true)

But is there a way I can convert markup to html, something like this in component js action method

showdown.Converter.makeHtml(fileContents)

yaxinr commented 5 years ago
import showdown from 'showdown';
import config from 'ember-get-config';

    converter = new showdown.Converter(config.showdown);
    converter.makeHtml(text);
SantoshRaoBlr commented 5 years ago

Thank you, will try