Class: Sevgi::Graphics::Content::CData
- Inherits:
-
Content
- Object
- Content
- Sevgi::Graphics::Content::CData
- Defined in:
- lib/sevgi/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) ⇒ void
Renders CDATA content.
Instance Method Details
#render(renderer, depth) ⇒ void
This method returns an undefined value.
Renders CDATA content.
Embedded ]]> terminators are split across adjacent CDATA sections so the output remains valid XML.
175 176 177 178 179 180 181 |
# File 'lib/sevgi/graphics/auxiliary/content.rb', line 175 def render(renderer, depth) depth += 1 renderer.append(depth, "<![CDATA[") renderer.append(depth + 1, *Array(payload).map { safe(it) }) renderer.append(depth, "]]>") end |