diff --git a/spec.txt b/spec.txt index 7977d961..baddf2f6 100644 --- a/spec.txt +++ b/spec.txt @@ -5716,9 +5716,16 @@ preceded nor followed by a backtick. A [code span](@) begins with a backtick string and ends with a backtick string of equal length. The contents of the code span are -the characters between the two backtick strings, with leading and -trailing spaces and [line endings] removed, and -[whitespace] collapsed to single spaces. +the characters between the two backtick strings, normalized in the +following ways: + +- First, [line endings] are converted to [spaces], unless they are + adjacent to [spaces], in which case they are ignored. +- If the string both begins *and* ends with a [space] character, + a single [space] character is removed from the front and back. + This allows you to include code that begins or ends with backtick + characters, which must be separated by whitespace from the opening + or closing backtick strings. This is a simple code span: @@ -5730,10 +5737,11 @@ This is a simple code span: Here two backticks are used, because the code contains a backtick. -This example also illustrates stripping of leading and trailing spaces: +This example also illustrates stripping of a single leading and +trailing space: ```````````````````````````````` example -`` foo ` bar `` +`` foo ` bar `` .
foo ` bar
``
foo
``
a
foo bar baz
b
a b
foo bar baz
foo
foo `` bar
foo bar baz
` elements, so it is recommended that
+the following CSS be used:
+
+ code{white-space: pre-wrap;}
+
Note that backslash escapes do not work in code spans. All backslashes
are treated literally:
@@ -5815,6 +5835,19 @@ Backslash escapes are never needed, because one can always choose a
string of *n* backtick characters as delimiters, where the code does
not contain any strings of exactly *n* backtick characters.
+```````````````````````````````` example
+``foo`bar``
+.
+foo`bar
+````````````````````````````````
+
+```````````````````````````````` example
+` foo `` bar `
+.
+foo `` bar
+````````````````````````````````
+
+
Code span backticks have higher precedence than any other inline
constructs except HTML tags and autolinks. Thus, for example, this is
not parsed as emphasized text, since the second `*` is part of a code
@@ -9008,7 +9041,7 @@ Line breaks do not occur inside code spans
`code
span`
.
-code span
+code span
````````````````````````````````