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

Preview don't work (i include to-markdown) #228

Open
LeValt opened this issue Mar 8, 2016 · 6 comments
Open

Preview don't work (i include to-markdown) #228

LeValt opened this issue Mar 8, 2016 · 6 comments

Comments

@LeValt
Copy link

LeValt commented Mar 8, 2016

Hello guys,

I do that on my header :

<script src ="js/to-markdown.js"></script> <script src ="js/bootstrap-markdown.js"></script>

I inverse the include order too, i tried a lot of thing, but the button preview still don't work...

Have an idea?

Thanks, valt

@chrise86
Copy link

chrise86 commented Apr 6, 2016

I'm having the same issue, did you manage to fix it @LeValt ?

@chrise86
Copy link

chrise86 commented Apr 6, 2016

Got it, missed the note at the bottom:

The preview functionalities and html to markdown conversion are provided by 3rd party codes : markdown-js, marked (default failover if markdown-js lib not available) and to-markdown. Without them, this plugin would still work and convert the content as-is, so you could easily modify those functionalities yourself via available hooks.

I think this needs to be made more prominent?

@xserrat
Copy link

xserrat commented May 3, 2016

Hi guys,

The 3rd party library didn't work for me @LeValt and @chrise86, but I found showdown.js library to solve the problem.

Good luck!

@teaqu
Copy link

teaqu commented Jan 19, 2017

I noticed the docs are using this fork of markdown-js.

I also ended up using showdown.js.

It was easy to setup:

<script>
    var markdown = new showdown.Converter();
    markdown.toHTML = function(val) {
        return markdown.makeHtml(val);
    }
</script>

@jlthompson3259
Copy link

I used marked.js. Just add it to your page and the preview button works great.

@BudgieInWA
Copy link

BudgieInWA commented Oct 12, 2017

You can pass an arbitrary markdown-to-html function using the parser option, like this:

var converter = showdown.Converter();
var convertFunction = converter.makeHtml.bind(converter);
$('textarea').markdown({
  parser: convertFunction, // or whatever
});

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

6 participants