Skip to content

Commit

Permalink
Merge pull request #3225 from aymeric-duchein/feat_notes_add_marked_o…
Browse files Browse the repository at this point in the history
…ptions

feat(notes): add marked options
  • Loading branch information
Hypnosphi authored Apr 1, 2018
2 parents d0d6e4f + c37fdf1 commit 2675c19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/notes/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import addons from '@storybook/addons';
import marked from 'marked';
import { WithNotes as ReactWithNotes } from './react';

export const withMarkdownNotes = text => {
export const withMarkdownNotes = (text, options) => {
const channel = addons.getChannel();

return getStory => context => {
marked.setOptions({ ...marked.defaults, options });
// send the notes to the channel before the story is rendered
channel.emit('storybook/notes/add_notes', marked(text));
return getStory(context);
Expand Down

0 comments on commit 2675c19

Please sign in to comment.