diff --git a/packages/guides-restructured-text/src/RestructuredText/Parser/Productions/CommentRule.php b/packages/guides-restructured-text/src/RestructuredText/Parser/Productions/CommentRule.php index 4083325d1..ae48f8953 100644 --- a/packages/guides-restructured-text/src/RestructuredText/Parser/Productions/CommentRule.php +++ b/packages/guides-restructured-text/src/RestructuredText/Parser/Productions/CommentRule.php @@ -56,11 +56,11 @@ private function isCommentLine(string|null $line): bool return false; } - return $this->isComment($line) || (trim($line) !== '' && $line[0] === ' '); + return $this->isComment($line) || trim($line) === '' || $line[0] === ' '; } private function isComment(string $line): bool { - return trim($line) === '..' || preg_match('/^\.\.\s+.*$/mUsi', $line) > 0; + return trim($line) === '..' || preg_match('/^\.\.\s+[^:]*$/mUsi', $line) > 0; } } diff --git a/tests/Functional/tests/comment-empty/comment-empty.html b/tests/Functional/tests/comment-empty/comment-empty.html index 9ba15270b..92b8ea639 100644 --- a/tests/Functional/tests/comment-empty/comment-empty.html +++ b/tests/Functional/tests/comment-empty/comment-empty.html @@ -1,4 +1 @@
this is not a comment
--diff --git a/tests/Integration/tests/class/class-directive/expected/index.html b/tests/Integration/tests/class/class-directive/expected/index.html index 97e674241..12fb9eb21 100644 --- a/tests/Integration/tests/class/class-directive/expected/index.html +++ b/tests/Integration/tests/class/class-directive/expected/index.html @@ -20,8 +20,6 @@this is a blockquote
-
A note without a class
-- diff --git a/tests/Integration/tests/class/class-directive/input/index.rst b/tests/Integration/tests/class/class-directive/input/index.rst index 2cf2194be..6464aee47 100644 --- a/tests/Integration/tests/class/class-directive/input/index.rst +++ b/tests/Integration/tests/class/class-directive/input/index.rst @@ -37,4 +37,4 @@ Document title .. - Block quote text. + This is a comment diff --git a/tests/Integration/tests/comments/comment-multiline/expected/index.html b/tests/Integration/tests/comments/comment-multiline/expected/index.html new file mode 100644 index 000000000..11b1e2498 --- /dev/null +++ b/tests/Integration/tests/comments/comment-multiline/expected/index.html @@ -0,0 +1,8 @@ + +Block quote text.
This text is no comment
+No comment!
This text is no comment
+After the node
+