pub fn lower_block_string(s: &str) -> StringExpand description
Lower a """...""" block literal to its string value. Escapes and
{{ }} pass through verbatim for runtime expand_string. Steps:
- Strip the delimiters, normalize
\r\nand lone\rto\n. - Leading newline: if the opening
"""is followed only by spaces/tabs then a newline, drop through that newline (split_leading_newline). Otherwise the opening line holds inline text ("""text), kept verbatim at zero indent and excluded from prefix computation. - Closing line: if the text holds a newline and the last line is
whitespace-only, the closing
"""sits on its own line. Pop that line (with its newline) and seat its whitespace as the indentation baseline among the prefix candidates. - Common prefix: longest shared leading-whitespace run across all non-blank content lines. Blank lines never vote. No qualifying line means an empty value.
- Strip the prefix from every non-blank line. The inline first line and blank lines pass through untouched.
- Rejoin the lines with
\n.