Skip to main content

write_html

Function write_html 

Source
pub fn write_html(grid: &RenderGrid) -> String
Available on crate feature output-html only.
Expand description

Encode grid as an HTML5 fragment.

Output shape:

<pre>
<span style="color:#RRGGBB">XX</span><span style="color:#RRGGBB">Y</span>
...
</pre>

Adjacent cells with identical foreground colors are coalesced into a single <span> to keep the output compact. The writer is pre-sized per FR-027 (String::with_capacity(w * h * 32)).