module documentation

ZMSTextformat.py - Text-format model and rendering helpers for ZMS rich-text output.

Text-format model and rendering helpers for ZMS rich-text output.

This module contains:

  1. br_quote: a helper that transforms plain text into HTML fragments while preserving line breaks, indentation, and simple nested list markers.
  2. ZMSTextformat: a small value object representing one configured text format (tag, optional sub-tag, attributes, and usage metadata), plus rendering helpers to convert input text into wrapped HTML.

License: GNU General Public License v2 or later, Organization: ZMS Publishing

Class ZMSTextformat Represent one text-format definition and provide rendering helpers.
Function br_quote Convert a plain text fragment to HTML according to the configured sub-tag.
def br_quote(self, text, subtag): (source) ΒΆ

Convert a plain text fragment to HTML according to the configured sub-tag.

The function preserves leading whitespace, supports <br> handling, injects management-interface markers for visible line breaks, and converts simple tab-prefixed list syntax ' * '/' #' into nested '<ul>'/'<ol>' structures.

Parameters
self:objectRendering context used to detect management interface mode.
text:strInput text to transform.
subtag:strOptional sub-tag name used for line wrapping (e.g. 'br').
Returns
strHTML fragment with transformed line and list markup.