Skip to content

Commit

Permalink
Callouts should not be parsed from nested code blocks (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz authored Dec 19, 2024
1 parent 6ddd7a6 commit fb33d8a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/source/markup/callout.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ project:
content: CC-BY-4.0 <1>
subject: MyST Markdown
```
1. The license
### C#
Expand Down
4 changes: 2 additions & 2 deletions docs/source/markup/substitutions.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Substitutions should work in code blocks too.
```{code} sh
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{{version}}-linux-x86_64.tar.gz
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{{version}}-linux-x86_64.tar.gz.sha512
shasum -a 512 -c elasticsearch-{{version}}-linux-x86_64.tar.gz.sha512 <1>
shasum -a 512 -c elasticsearch-{{version}}-linux-x86_64.tar.gz.sha512
tar -xzf elasticsearch-{{version}}-linux-x86_64.tar.gz
cd elasticsearch-{{version}}/ <2>
cd elasticsearch-{{version}}/
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ public override bool Close(BlockProcessor processor, Block block)
span = lines.Lines[index].Slice.AsSpan();
}

if (codeBlock.OpeningFencedCharCount > 3)
continue;

var matchClassicCallout = CallOutParser.CallOutNumber().EnumerateMatches(span);
var callOut = EnumerateAnnotations(matchClassicCallout, ref span, ref callOutIndex, originatingLine, false);

Expand Down

0 comments on commit fb33d8a

Please sign in to comment.