NAME

Text::AsciidocDown::Subs - Attribute substitution and inline formatting

SYNOPSIS

use Text::AsciidocDown::Subs;

my $attrs = Text::AsciidocDown::Subs::build_attributes(\%runtime);
my $text  = Text::AsciidocDown::Subs::apply_normal_subs($input, $attrs);

DESCRIPTION

This module provides attribute building, attribute reference substitution, and inline formatting/macro expansion for Text::AsciidocDown. It is not intended for direct use; callers should use the OO interface provided by Text::AsciidocDown.

INTERFACE

build_attributes

my $attrs = Text::AsciidocDown::Subs::build_attributes(\%runtime);

Builds a complete attribute hash from runtime attributes, adding built-in defaults (empty, idprefix, idseparator, nbsp, quotes, sp, vbar, zwsp, and Markdown-specific attributes).

substitute_attributes

my $text = Text::AsciidocDown::Subs::substitute_attributes($text, $attrs);

Substitutes {name} attribute references in the text with their values.

apply_normal_subs

my $text = Text::AsciidocDown::Subs::apply_normal_subs($text, $attrs);

Applies the full normal substitution chain:

  • Escape < outside monospace

  • Apply AsciiDoc quotes ("`text`")

  • Inline formatting (bold, emphasis, monospace, mark, strikethrough)

  • Attribute substitution

  • Macros (anchors, images, links, xrefs)

  • Curly apostrophe conversion

block_image_to_markdown

my $md = Text::AsciidocDown::Subs::block_image_to_markdown($line, $attrs);

Converts a block image macro (image::[]) to Markdown if the line matches.

image_to_markdown

my $md = Text::AsciidocDown::Subs::image_to_markdown($target, $attrlist, $attrs);

Converts an image macro to Markdown ![]() syntax.

escape_lt_outside_monospace

my $text = Text::AsciidocDown::Subs::escape_lt_outside_monospace($text);

Escapes angle brackets to HTML entities while preserving xref shortcuts.

AUTHOR

Sandor Patocs

LICENSE

Same terms as Perl itself.