Packages
earmark_parser
1.4.10
1.4.46
1.4.45
1.4.44
1.4.43
1.4.42
1.4.41
1.4.40
1.4.39
1.4.38
1.4.37
1.4.36
1.4.35
1.4.34
1.4.33
1.4.32
1.4.31
1.4.30
1.4.29
1.4.28
1.4.27
1.4.26
1.4.25
1.4.24
1.4.23
1.4.22
1.4.21
1.4.20
1.4.20-pre
1.4.19
1.4.18
1.4.17
1.4.16
1.4.16-pre2
1.4.16-pre1
1.4.16-pre
1.4.15
1.4.13
1.4.12
1.4.11
1.4.10
1.4.9
1.4.8
AST parser and generator for Markdown
Current section
Files
Jump to
Current section
Files
lib/earmark_parser/options.ex
defmodule EarmarkParser.Options do
use EarmarkParser.Types
# What we use to render
defstruct renderer: EarmarkParser.HtmlRenderer,
# Inline style options
gfm: true,
gfm_tables: false,
breaks: false,
pedantic: false,
smartypants: true,
footnotes: false,
footnote_offset: 1,
# additional prefies for class of code blocks
code_class_prefix: nil,
# Add possibility to specify a timeout for Task.await
timeout: nil,
# Internal—only override if you're brave
do_smartypants: nil,
# Very internal—the callback used to perform
# parallel rendering. Set to &Enum.map/2
# to keep processing in process and
# serial
mapper: &EarmarkParser.pmap/2,
mapper_with_timeout: &EarmarkParser.pmap/3,
# Filename and initial line number of the markdown block passed in
# for meaningfull error messages
file: "<no file>",
line: 1,
# [{:error|:warning, lnb, text},...]
messages: [],
pure_links: true
@type t :: %__MODULE__{
breaks: boolean,
code_class_prefix: maybe(String.t),
footnotes: boolean,
footnote_offset: number,
gfm: boolean,
pedantic: boolean,
pure_links: boolean,
smartypants: boolean,
timeout: maybe(number)
}
@doc false
# Only here we are aware of which mapper function to use!
def get_mapper(options) do
if options.timeout do
&options.mapper_with_timeout.(&1, &2, options.timeout)
else
options.mapper
end
end
@doc false
def plugin_for_prefix(options, plugin_name) do
Map.get(options.plugins, plugin_name, false)
end
end
# SPDX-License-Identifier: Apache-2.0