mermaid.label.decode

mermaid.label

decode(raw) -> lines

Turn a label's source text into its lines

Strips one pair of double quotes, and the backticks of a markdown string inside them. Reads <br>, <br/> and a newline as a line break, and an entity code (#quot;, #35;) as its character. An unknown code stays as written. Each line comes back trimmed, with runs of blanks as one space. A label of blanks alone is one empty line.

No control character comes out. A raw one is dropped, but for a tab, a newline and the other blanks, which read as blanks. An entity code for a control character (#27;, #155;) or a surrogate stays as written.