Back to API Reference
Class

ModifierHtmlSchema

sealed

HTML element pair that a modifier produces on copy and recognises on paste. Wraps OpenTagTemplate + CloseTag around the inner text on copy; matches any of RecognizedElements on paste.

Remarks

Templates may include the literal placeholder {value} which is substituted with the modifier's tag parameter at copy time (e.g. <span style="color:{value}"> emits <span style="color:red"> when the modifier was applied with parameter red). Parameterless modifiers (bold, italic) leave the template without a placeholder. RecognizedElements are case-insensitive HTML element names accepted on paste. A bold modifier typically declares {"b", "strong"}; an italic modifier {"i", "em"}. The first match wins — list semantically equivalent element names together rather than registering one schema per name.
public string OpenTagTemplate{ get }

HTML open tag emitted on copy. May contain the literal placeholder {value} for the modifier's tag parameter.

public string CloseTag{ get }

HTML close tag emitted on copy. Typically the matching </element>.

public IReadOnlyList<string> RecognizedElements{ get }

Case-insensitive HTML element names this schema matches on paste. Never; never empty.

public HtmlParameterExtractor ExtractParameter{ get }

Optional callback that derives the UniText modifier parameter from the raw attribute slice of a matched HTML element on paste. Receives the substring between the element name and the closing > — e.g. for <span style="color:red"> the callback receives style="color:red". Returns the parameter value to splice into the UniText source tag (e.g. "red"), or when the element does not actually express this modifier (in which case the adapter keeps the inner content but does not wrap it). callback means the modifier is parameterless.

public CssValueConverter ToCss{ get }

Optional converter applied to the modifier's tag parameter before it substitutes {value} on copy. Returning skips this schema's wrapper for the span (the content still copies) — invalid CSS is never emitted. converter means the parameter is already a valid CSS value.

public bool HasValuePlaceholder{ get }

Whether OpenTagTemplate carries the {value} placeholder — such a schema cannot emit without a parameter.

[ctor]public ModifierHtmlSchema()
[ctor]public ModifierHtmlSchema()
[ctor]public ModifierHtmlSchema()