<pre>
The <pre> is a Paragraph Markup
component that renders a block of text that preserves the formatting of the text directly as
input into the editor, including line spacing, font and indentation.
Attributes and Properties
Attributes for <pre>
Common to all components (9)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
hideboolean. Default value: false. Whether to hide this component from the rendered output.
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <pre name="p">
Other (4)
$p.disabledboolean. Whether this component is disabled and cannot be interacted with.
$p.fixedboolean. Whether this component's value is fixed and cannot be modified.
$p.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
Common to all components (4)
$p.doenetMLtext. The DoenetML source code that produced this component.
$p.hideboolean. Whether to hide this component from the rendered output.
$p.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$p.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Using <pre> to modify default spacing
The <pre> component is used to precisely
space the lines of a Haiku as they are typed in the editor.