module

Asciidoctor::Substitutors

Module included in AbstractBlock subclasses to provide text substitution capabilities.

Instance methods

apply_header_subs(text : String) : String

Apply header substitutions to the text.

Source
apply_normal_subs(text : String) : String

Apply normal substitutions to the text.

Source
apply_reftext_subs(text : String) : String

Apply reftext substitutions to the text.

Source
apply_subs(text : String, subs : Array(Symbol)) : String

Apply the specified substitutions to the text.

Source
apply_subs_str(value : String) : String

Apply substitutions to a String value (convenience for AttributeList).

Source
commit_subs

Commit substitutions based on content model and custom subs attribute.

Source
expand_subs(subs : Array(Symbol)) : Array(Symbol) | Nil

Expand all groups in the subs list.

Source
extract_callouts(source : String) : Tuple(String, Hash(Int32, Array(Tuple(String | Nil, String))) | Nil)

Extract the callout numbers from the source to prepare it for syntax highlighting.

Source
extract_passthroughs(text : String) : String

Extract passthrough text from the document for reinsertion after processing.

Source
highlight_source(source : String, process_callouts : Bool) : String

Highlight the source code in the given text using the syntax highlighter registered with the document, if available.

Source
normalize_text(text : String, normalize_whitespace : Bool | Nil = nil, unescape_closing_square_brackets : Bool | Nil = nil) : String

Normalize text by stripping whitespace and folding newlines.

Source
parse_inline_attributes(attrlist : String, positional_attrs : Array(String) = [] of String) : Hash(String, String)

Parse inline attributes from an attrlist string.

Source
parse_quoted_text_attributes(str : String) : Hash(String, String)

Parse quoted text attributes (role and id shorthand).

Source
resolve_block_subs(subs : String, defaults : Array(Symbol), subject : String | Nil = nil) : Array(Symbol) | Nil

Resolve block substitutions.

Source
resolve_lines_to_highlight(source : String, spec : String, start : Int32 | Nil = nil) : Array(Int32)

Resolve the line numbers in the specified source to highlight from the provided spec.

Source
resolve_pass_subs(subs : String, subject : String = "passthrough macro") : Array(Symbol)

Resolve pass substitutions.

Source
resolve_subs(subs : String, type : Symbol = :block, defaults : Array(Symbol) | Nil = nil, subject : String | Nil = nil) : Array(Symbol) | Nil

Resolve comma-delimited subs against the possible options.

Source
restore_callouts(source : String, callout_marks : Hash(Int32, Array(Tuple(String | Nil, String))), source_offset : Int32 | Nil = nil) : String

Restore the callout numbers to the highlighted source.

Source
restore_passthroughs(text : String) : String

Restore the passthrough text by reinserting into the placeholder positions.

Source
split_simple_csv(str : String) : Array(String)

Split text formatted as CSV with support for double-quoted values.

Source
sub_attributes(text : String) : String

Substitute attribute references.

Source
sub_callouts(text : String) : String

Substitute callout markers in source listings.

Source
sub_macros(text : String) : String

Substitute inline macros (links, images, footnotes, etc.).

Source
sub_post_replacements(text : String) : String

Substitute post replacements (hard line breaks).

Source
sub_quotes(text : String) : String

Substitute quoted text (bold, italic, monospace, etc.).

Source
sub_replacements(text : String) : String

Substitute replacement characters.

Source
sub_source(source : String, process_callouts : Bool) : String

Substitute source code with optional callout processing.

Source
sub_specialchars(text : String) : String

Substitute special characters (XML entities).

Source