Preformatted text
Preformatted text is text that contains line breaks and spaces that are intended to be preserved at publication time.
Syntax
- XDITA
<pre>
- HDITA
<pre>
- MDITA (core and extended profiles)
Fenced code blocks (e.g.
```text```
) or indented code blocks (e.g.text
) (how to indicate an indent???)
Rendering expectations
Processors SHOULD preserve the line breaks and spaces that are present in preformatted text.
The code block component is typically rendered in a monospaced font.
Attributes
The available attributes vary based on the authoring format:
- XDITA
- The following attributes are available on this element: ID
attributes, localization attributes,
universal
attributes,
@props
, and the additional attribute listed below. - HDITA
- The following attributes are available on this element: ID
attributes, localization attributes,
universal
attributes,
and
@props
- MDITA
- There is no attribute support for the MDITA core profile. For the MDITA extended profile, attributes can be specified by using the HDITA representation.
For XDITA, the following additional attribute is also available:
@xml:space
- Specifies how to handle white space in the current element. It ensures that parsers respect white space that is part of the data in those elements, including line-end characters. When defined, it has a fixed value of preserve, making it a default property of the element that cannot be changed or deleted by authors.
Examples
This section is non-normative.