DomUI

EmbeddedCode

EmbeddedCode shows a piece of code as code.

cp.add(new EmbeddedCode("SELECT * FROM Album WHERE title ilike '%rock%'"));

The whole component is a div with the class ui-embcd and one span holding the text, so what it looks like is entirely the theme's business. The text is added as text: it is escaped, not interpreted, so code containing < and & shows as written.

It does not highlight anything. For highlighted, editable code the component is the AceEditor; for showing html as html it is DisplayHtml.

Last modified: 2026/09/05