Skip to content

Conversation

tmbb
Copy link
Contributor

@tmbb tmbb commented Aug 2, 2017

Code blocks are now handled by the markdown modules,
and ExDoc doesn't do any post-processing.

The modules bundled with ExDoc were updated to reflect this.

The goal of this change is to make it easier to use alternative Markdown
implementations.

This might break compatibility for people that are already usin Markdown
extensions.

The code for the Hoedown module wasn't changed because it already handled the postprocessing of code blocks itself.

All unit tests pass, and my visual integration test with Earmark on a real project showed no differences.

Code blocks are now handled by the markdown modules,
and ExDoc doesn't do any post-processing.

The modules bundled with ExDoc were updated to reflect this.

The goal of this change is to make it easier to use alternative Markdown
implementations.

This might break compatibility for people that are already usin Markdown
extensions.
@josevalim josevalim merged commit ccfd84e into elixir-lang:master Aug 2, 2017
@josevalim
Copy link
Member

❤️ 💚 💙 💛 💜

Copy link
Member

@milmazz milmazz left a comment

Choose a reason for hiding this comment

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

@tmbb I added a few suggestions.

"""
def to_html(text, _opts) do
Cmark.to_html(text)
Cmark.to_html(text) |> ExDoc.Markdown.pretty_codeblocks
Copy link
Member

Choose a reason for hiding this comment

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

@tmbb This is a nitpick, but it should be:

text |> Cmark.to_html() |> ExDoc.Markdown.pretty_codeblocks()

breaks: Keyword.get(opts, :breaks, false),
smartypants: Keyword.get(opts, :smartypants, true))
Earmark.as_html!(text, options)
Earmark.as_html!(text, options) |> ExDoc.Markdown.pretty_codeblocks
Copy link
Member

Choose a reason for hiding this comment

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

@tmbb Another nitpick:

text |> Earmark.as_html!(options) |> ExDoc.Markdown.pretty_codeblocks()

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

Successfully merging this pull request may close these issues.

3 participants