Skip to content

Commit

Permalink
Fix HtmlBlockSyntax (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhiguang committed Jun 27, 2023
1 parent bd6ae8d commit 4674d09
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/src/block_syntaxes/html_block_syntax.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,9 @@ class HtmlBlockSyntax extends BlockSyntax {
parser.advance();
}

// If the following lines start an HTML block again, put them together with
// current HTML block.
if (!parser.isDone &&
parser.next != null &&
pattern.hasMatch(parser.next!.content)) {
parser.advance();
// If the current line start an HTML block again, put them together with
// the previous HTML block.
if (!parser.isDone && pattern.hasMatch(parser.current.content)) {
lines.addAll(parseChildLines(parser));
}

Expand Down
11 changes: 11 additions & 0 deletions test/original/html_block.unit
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
>>> issue https://github.com/dart-lang/markdown/issues/547
<?code-excerpt ?>
```xml
<q>
</q>
```
<<<
<?code-excerpt ?>
<pre><code class="language-xml">&lt;q&gt;
&lt;/q&gt;
</code></pre>

0 comments on commit 4674d09

Please sign in to comment.