1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-12-24 16:48:52 -05:00

XEP-0393: reorder span and block sections

This commit is contained in:
Sam Whited 2018-02-15 15:20:08 -06:00
parent c35dd875c7
commit 5027edb84f

View File

@ -202,6 +202,83 @@
</dl>
</section1>
<section1 topic='Business Rules' anchor='rules'>
<section2 topic='Blocks' anchor='block'>
<p>
Parsers implementing message styling will first parse blocks and then
parse child blocks or spans if allowed by the specific block type.
</p>
<section3 topic='Plain' anchor='line-block'>
<p>
Groups of lines that are not part of any other block are considered a
"plain" block, as are individual lines of text that are not inside of a
preformatted text block.
Plain blocks are not bound by styling directives and do not imply
formatting themselves, but they may contain spans which imply
formatting.
</p>
<example caption='Plain block text'><![CDATA[
<body>
((There are four blocks in this body marked by parens,)
(but there is no *formatting)
(as spans* may not escape blocks.))
</body>
]]></example>
</section3>
<section3 topic='Preformatted Text' anchor='pre-block'>
<p>
A preformatted text block is started by a line beginning with "```"
(U+0060 GRAVE ACCENT), and ended by a line containing only three grave
accents or the end of the parent block (whichever comes first).
Preformatted text blocks cannot contain child blocks and other styling
MUST NOT be rendered inside the block.
Text inside a preformatted block SHOULD be displayed in a monospace font.
</p>
<example caption='Preformatted block text'><![CDATA[
<body>
```ignored
(println &quot;Hello, world!&quot;)
```
This should show up as monospace, preformatted text ⤴
</body>
]]></example>
<example caption='No closing preformatted text sequence'><![CDATA[
<body>
&gt; ```
&gt; (println &quot;Hello, world!&quot;)
The entire blockquote is a preformatted text block, but this line is
plaintext!
</body>
]]></example>
</section3>
<section3 topic='Quotations' anchor='quote'>
<p>
A quotation is indicated by one or more lines with a byte stream
beginning with a '&gt;' (U+003E GREATER-THAN SIGN).
Block quotes may contain any child block, including other quotations.
Lines inside the block quote MUST have leading spaces trimmed before
parsing the child block.
It is RECOMMENDED that text inside of a block quote be indented or
distinguished from the surrounding text in some other way.
</p>
<example caption='Quotation (LTR)'><![CDATA[
<body>
&gt; That that is, is.
Said the old hermit of Prague.
</body>
]]></example>
<example caption='Nested Quotation'><![CDATA[
<body>
&gt;&gt; That that is, is.
&gt; Said the old hermit of Prague.
Who?
</body>
]]></example>
</section3>
</section2>
<section2 topic='Spans' anchor='span'>
<p>
Matches of spans between two styling directives MUST contain some text
@ -302,83 +379,6 @@
<body>
Wow, I can write in `monospace`!
</body>
]]></example>
</section3>
</section2>
<section2 topic='Blocks' anchor='block'>
<p>
Parsers implementing message styling will first parse blocks and then
parse child blocks or spans if allowed by the specific block type.
</p>
<section3 topic='Plain' anchor='line-block'>
<p>
Groups of lines that are not part of any other block are considered a
"plain" block, as are individual lines of text that are not inside of a
preformatted text block.
Plain blocks are not bound by styling directives and do not imply
formatting themselves, but they may contain spans which imply
formatting.
</p>
<example caption='Plain block text'><![CDATA[
<body>
((There are four blocks in this body marked by parens,)
(but there is no *formatting)
(as spans* may not escape blocks.))
</body>
]]></example>
</section3>
<section3 topic='Preformatted Text' anchor='pre-block'>
<p>
A preformatted text block is started by a line beginning with "```"
(U+0060 GRAVE ACCENT), and ended by a line containing only three grave
accents or the end of the parent block (whichever comes first).
Preformatted text blocks cannot contain child blocks and other styling
MUST NOT be rendered inside the block.
Text inside a preformatted block SHOULD be displayed in a monospace font.
</p>
<example caption='Preformatted block text'><![CDATA[
<body>
```ignored
(println &quot;Hello, world!&quot;)
```
This should show up as monospace, preformatted text ⤴
</body>
]]></example>
<example caption='No closing preformatted text sequence'><![CDATA[
<body>
&gt; ```
&gt; (println &quot;Hello, world!&quot;)
The entire blockquote is a preformatted text block, but this line is
plaintext!
</body>
]]></example>
</section3>
<section3 topic='Quotations' anchor='quote'>
<p>
A quotation is indicated by one or more lines with a byte stream
beginning with a '&gt;' (U+003E GREATER-THAN SIGN).
Block quotes may contain any child block, including other quotations.
Lines inside the block quote MUST have leading spaces trimmed before
parsing the child block.
It is RECOMMENDED that text inside of a block quote be indented or
distinguished from the surrounding text in some other way.
</p>
<example caption='Quotation (LTR)'><![CDATA[
<body>
&gt; That that is, is.
Said the old hermit of Prague.
</body>
]]></example>
<example caption='Nested Quotation'><![CDATA[
<body>
&gt;&gt; That that is, is.
&gt; Said the old hermit of Prague.
Who?
</body>
]]></example>
</section3>
</section2>