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

Correct Slack Markdown code block variant #4878

Merged
merged 2 commits into from
Feb 9, 2018

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented Feb 5, 2018

Description

This corrects pasting code blocks from Slack. Unfortunately they insist on another Markdown variant, so I see no other way of fixing the code block right before we call showdown.

This is `inline code`.
```This is a code block.```

Adds tests.

Also adds showdown option to not add extra line break to code blocks.

How Has This Been Tested?

Copy some text with a code block from Slack. Before it would put the code inline. Now it should create a code block.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code has proper inline documentation.

@ellatrix
Copy link
Member Author

ellatrix commented Feb 5, 2018

Also added the simpleLineBreaks option to preserve line breaks. This is very useful outside Slack paste too.

@ellatrix ellatrix requested a review from a team February 7, 2018 09:49
Copy link
Contributor

@mcsf mcsf left a comment

Choose a reason for hiding this comment

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

Nice. :)

@ellatrix
Copy link
Member Author

ellatrix commented Feb 9, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants