Skip to content

Loading…

Extensions Documentation #36

Closed
brianherbert opened this Issue · 3 comments

2 participants

@brianherbert

The documentation for building extensions seems to be pretty good. However, I've been unsuccessful at getting extensions to load.

A couple errors when following the documentation:

  1. TypeError: showdown is not a constructor. I've found that removing the () after "new Showdown"
new Showdown().converter({ extensions: 'twitter' });

... seems to help. However, I hit another hurdle.

  1. I keep getting a "TypeError: converter_options.extensions.forEach is not a function". Upon further inspection, the converter_options array is just an array of strings. There is no forEach function assigned to them.

I'm not really sure how to proceed and I haven't seen any working extension examples anywhere. Is there any way they could be included in the example?

Thanks!

@coreyti coreyti added a commit that referenced this issue
@coreyti coreyti [#36] iterate with Showdown.forEach
* browser support: [].forEach is not always available.
* also using Showdown.forEach in the test suite, to set the pattern.
7c28d37
@coreyti coreyti added a commit that referenced this issue
@coreyti coreyti [#36] correct documentation.
Showdown is not a constructor.
126de06
@coreyti coreyti added a commit that referenced this issue
@coreyti coreyti [#36] regenerate output e64d1fe
@coreyti

Hi @brianherbert, thanks for the heads-up.

  1. I've corrected the README per your catch.
  2. I suspect you were testing in a browser that does not support Array.forEach (e.g., IE8). I've updated showdown to use the forEach helper it defines and think that should resolve the issue for you.

Please take a look and let me know how it goes.

@brianherbert

I'm using Firefox 16 on OSX. When I looked at converter_options and converter_options.extensions in the console, they were strings, not objects.

Anyway, let me give this a shot and see what's up.

@brianherbert

It works now! Thanks! I'll go ahead and close this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.