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

[draft-js-export-markdown] Support code fence #159

Merged
merged 3 commits into from
Jan 14, 2019
Merged

Conversation

sstur
Copy link
Owner

@sstur sstur commented Jan 11, 2019

This adds support for an option to export Github-style fenced code blocks.

You can pass a second (optional) argument like so:

stateToMarkdown(contentState, options)

The only option currently supported is:

{gfm: true}

The test-cases.txt file as been updated to allow passing options after the description (separated by a "|").

This PR addresses withspectrum/spectrum#4472.

@sstur sstur changed the title [WIP] [draft-js-export-markdown] Support code fence [draft-js-export-markdown] Support code fence Jan 11, 2019
Copy link
Collaborator

@mxstbr mxstbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe calling the option gfm: true as it is called in draft-js-import-markdown would make sense? Other than that, this looks perfect!

@sstur
Copy link
Owner Author

sstur commented Jan 14, 2019

OK, done. I've made that change.

The reason for calling it codeFence is because I'm not sure what other GFM features there are and which ones we might want to support in the future and if we'd want to give them separate options (meaning if you're using gfm: true and later we add another gfm feature under that option, you, as the consumer, might one day get some changes to the way your stuff works without realizing it.)

That being said, I'm going to land this with your suggestion and yolo 😄

@sstur sstur merged commit 92f4a17 into master Jan 14, 2019
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

Successfully merging this pull request may close these issues.

2 participants