Earmark v1.2.4 Earmark.Helpers.LookaheadHelpers

Link to this section Summary

Functions

Indicates if the numbered_line passed in leaves an inline code block open

Called to slurp in the lines for a list item. basically, we allow indents and blank lines, and we allow text lines only after an indent (and initially) We also slurp in lines that are inside a multiline inline code block as indicated by pending

returns false if and only if the line closes a pending inline code without opening a new one. The opening backtix are passed in as second parameter. If the function does not return false it returns the (new or original) opening backtix

Link to this section Types

Link to this type inline_code_continuation()
inline_code_continuation() :: {nil | String.t(), number()}
Link to this type maybe(t)
maybe(t) :: t | nil
Link to this type message()
message() :: {message_type(), number(), String.t()}
Link to this type message_type()
message_type() :: :warning | :error
Link to this type numbered_line()
numbered_line() :: %{line: String.t(), lnb: number()}
Link to this type read_list_info()
read_list_info() :: %{pending: maybe(String.t()), pending_lnb: number(), initial_indent: number(), min_indent: maybe(number())}
Link to this type token()
token() :: {atom(), String.t()}
Link to this type tokens()
tokens() :: [token()]

Link to this section Functions

Link to this function opens_inline_code(map)
opens_inline_code(numbered_line()) :: inline_code_continuation()

Indicates if the numbered_line passed in leaves an inline code block open.

If so returns a tuple whre the first element is the opening sequence of backticks, and the second the linenumber of the numbered_line

Otherwise {nil, 0} is returned

Link to this function read_list_lines(lines, arg, initial_indent)
read_list_lines(Earmark.Line.ts(), inline_code_continuation(), number()) :: {boolean(), Earmark.Line.ts(), Earmark.Line.ts(), number(), number()}

Called to slurp in the lines for a list item. basically, we allow indents and blank lines, and we allow text lines only after an indent (and initially) We also slurp in lines that are inside a multiline inline code block as indicated by pending.

Link to this function still_inline_code(map, old)

returns false if and only if the line closes a pending inline code without opening a new one. The opening backtix are passed in as second parameter. If the function does not return false it returns the (new or original) opening backtix