winterthediplomat/md2bbc

Extensions and single backticks shouldn't be parsed inside code sections

Closed this issue · 0 comments

```perl
use Data::Dumper;
print '@lol';
print "#md2bbc";
print "~~deleted~~";
print Dumper($val);
print "do you wanna use `lol` ?"; 
\```

in md2bbc, this snippet generates

[code=perl]
use Data::Dumper;
print '[lol](https://nerdz.eu/lol.)';
print "[md2bbc](https://nerdz.eu/md2bbc:)";
print "[del]deleted[/del]";
print Dumper($val);
print "do you wanna use [code]lol[/code] ?"; 
[/code]

This means that extensions applied before the parsing are (incorrectly, in this case) applied into the code sections. The single backtick (that's not an extension) is incorrectly parsed too.

The syntax reference on code tags specifies

Regular Markdown syntax is not processed within code blocks. E.g., asterisks are just literal asterisks within a code block. This means it’s also easy to use Markdown to write about Markdown’s own syntax.