Skip to content

Commit

Permalink
Disable earmark smartypants option by default (#929)
Browse files Browse the repository at this point in the history
Fixes #928
  • Loading branch information
axelson authored and josevalim committed Nov 30, 2018
1 parent 6b146b0 commit b8ce799
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ex_doc/markdown/earmark.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ defmodule ExDoc.Markdown.Earmark do
breaks significant (so every line in the input is a new line in the output)
* `: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
two or three hyphens become en and em dashes, and so on. False 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
Expand All @@ -43,7 +43,7 @@ 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, false),
plugins: Keyword.get(opts, :plugins, %{})
)

Expand Down
4 changes: 4 additions & 0 deletions test/ex_doc/markdown/earmark_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ defmodule ExDoc.Markdown.EarmarkTest do
test "to_html handles empty input" do
assert Markdown.to_html("", []) == ""
end

test "to_html does not generate smart quotes by default" do
assert Markdown.to_html("\"hi\"", []) =~ ""hi""
end
end

0 comments on commit b8ce799

Please sign in to comment.