Class: Sumi::Graphics::Content::CData
- Inherits:
-
Content
- Object
- Content
- Sumi::Graphics::Content::CData
- Defined in:
- graphics/lib/sumi/graphics/auxiliary/content.rb
Overview
CDATA section content backed by an immutable payload snapshot. Mutable leaf objects are stringified during construction. Embedded terminators are split during rendering.
Instance Method Summary collapse
-
#render(renderer, depth) ⇒ Object
Renders CDATA content.
Instance Method Details
#render(renderer, depth) ⇒ Object
Renders CDATA content.
Embedded ]]> terminators are split across adjacent CDATA sections so the output remains valid XML.
137 138 139 140 141 142 143 |
# File 'graphics/lib/sumi/graphics/auxiliary/content.rb', line 137 def render(renderer, depth) depth += 1 renderer.append(depth, "<![CDATA[") renderer.append(depth + 1, *Array(payload).map { safe(it) }) renderer.append(depth, "]]>") end |