empress/ember-cli-showdown

Default options and extensions set via `config/environment.js`.

Closed this issue · 2 comments

This is a feature request.

Passing the same options to each instance of markdown-to-html is super tedious!

One option you can do until this lands:

// app/components/markdown-to-html
import Ember from 'ember';
import ENV from '../config/environment';
import ShowdownComponent from 'ember-cli-showdown/components/markdown-to-html';

const { get, computed } = Ember;

export default ShowdownComponent.extend({
  extensions: computed(function() {
     return get(ENV, 'showdown.defaultExtensions');
  })
});

2.11.0