Class: Metanorma::Document::Components::AncillaryBlocks::SourcecodeBody
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Metanorma::Document::Components::AncillaryBlocks::SourcecodeBody
- Defined in:
- lib/metanorma/document/components/ancillary_blocks/sourcecode_body.rb
Instance Method Summary collapse
-
#decoded_content ⇒ Object
The source text with XML entities DECODED (
<→<).
Instance Method Details
#decoded_content ⇒ Object
The source text with XML entities DECODED (< → <).
content is markup-encoded by design: map_all_content keeps
the raw inner markup so to_xml can re-emit it verbatim
(roundtrip fidelity). Consumers that display the code as
text need the decoded form — without it they double-escape
(&lt;) or hand-roll fragile gsub chains. Comments in
the listing stay literal ("").
25 26 27 |
# File 'lib/metanorma/document/components/ancillary_blocks/sourcecode_body.rb', line 25 def decoded_content CGI.unescapeHTML(Array(content).join) end |