diff --git a/xep-0393.xml b/xep-0393.xml index 45701a8a..61e7ad02 100644 --- a/xep-0393.xml +++ b/xep-0393.xml @@ -25,6 +25,16 @@ styling &sam; + + 0.1.2 + 2018-01-13 + ssw + +

+ Clarify block quote and plain text parsing and formatting behavior. +

+
+
0.1.1 2018-01-12 @@ -98,6 +108,22 @@ + +
    +
  • + As a user sending an instant message to a friend, I want to be able to + emphasize an important part of my message. +
  • +
  • + As a software developer, I want to be able to send code as pre-formatted, + monospace, block or inline text to another developer. +
  • +
  • + As a multi-user chat user I want to add context to my reply by quoting an + earlier message in the chat. +
  • +
+

Many important terms used in this document are defined in &unicode;. @@ -175,32 +201,15 @@ - -

    -
  • - As a user sending an instant message to a friend, I want to be able to - emphasize an important part of my message. -
  • -
  • - As a software developer, I want to be able to send pre-formatted, - monospace, block or inline text to another developer. -
  • -
  • - As a multi-user chat user I want to quote something someone said earlier - in the chat and make it evident that the text is a quotation. -
  • -
-

Matches of spans between two styling directives MUST contain some text between the two styling directives and the opening styling directive MUST be located at the beginning of the line, or after a whitespace character. - The opening styling directive MUST also not be followed by a whitespace - character. - The closing styling directive MUST NOT be preceeded by a whitespace - character. + The opening styling directive MUST NOT be followed by a whitespace + character and the closing styling directive MUST NOT be preceeded by a + whitespace character. Spans are always parsed from the beginning of the byte stream to the end and are lazily matched. Characters that would be styling directives but do not follow these rules @@ -229,10 +238,21 @@

  • **
  • ****
  • + +

    + Any text inside of a block that is not part of another span is + implicitly considered to be inside of a "plain text" span. +

    + + (Two spans, both )(*alike in dignity*) + +]]> +

    - Text enclosed by '*' (U+002A ASTERISK) is strong SHOULD be displayed as - bold. + Text enclosed by '*' (U+002A ASTERISK) is strong and SHOULD be displayed + with a heavier font weight than the surrounding text (bold).

    @@ -268,7 +288,7 @@

    Text enclosed by a '`' (U+0060 GRAVE ACCENT) is a preformatted span SHOULD be displayed inline in a monospace font. - A preformatted span may only contain plaintext. + A preformatted span may only contain a single plain span. Inline formatting directives inside the preformatted span are not rendered. For example, the following all contain valid preformatted spans: @@ -286,7 +306,28 @@ - +

    + Parsers implementing message styling will first parse blocks and then + parse child blocks or spans if allowed by the specific block type. +

    + +

    + 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. +

    + + ((There are four blocks in this body marked by parens,) + (but there is no *formatting) + (as spans* may not escape blocks.)) + +]]> +
    +

    A preformatted text block is started by a line beginning with "```" (U+0060 GRAVE ACCENT), and ended by a line containing only three grave @@ -316,11 +357,13 @@

    - A quotation is indicated by one or more lines with a byte stream beginning - with a '>' (U+003E GREATER-THAN SIGN). + A quotation is indicated by one or more lines with a byte stream + beginning with a '>' (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.