Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/ex_doc/markdown/earmark.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ defmodule ExDoc.Markdown.Earmark do
* `:smartypants` - boolean. Turns on smartypants processing, so quotes become curly,
two or three hyphens become en and em dashes, and so on. True by default

* `:plugins` - map of strings to modules. Register custom plugins to be used with
Earmark. See [Plugins](http://github.com/pragdave/earmark#plugins) for details on
how to write custom plugins.

"""
def to_html(text, opts) do
options =
Expand All @@ -40,7 +44,8 @@ defmodule ExDoc.Markdown.Earmark do
line: Keyword.get(opts, :line, 1),
file: Keyword.get(opts, :file),
breaks: Keyword.get(opts, :breaks, false),
smartypants: Keyword.get(opts, :smartypants, true))
smartypants: Keyword.get(opts, :smartypants, true),
plugins: Keyword.get(opts, :plugins, %{}))
text |> Earmark.as_html!(options) |> ExDoc.Markdown.pretty_codeblocks()
end
end