antononcube / Raku-Markdown-Grammar

Markdown parser suitable for generation of notebooks of different kind (Mathematica, RMarkdown, Jupyter.)
https://raku.land/zef:antononcube/Markdown::Grammar
Artistic License 2.0
9 stars 3 forks source link

The code block translation is still broken #3

Closed tbrowder closed 2 years ago

tbrowder commented 2 years ago

Given this in Markdown (the apostrophes represent backticks):

'''json

This module still creates:

=begin code json

which causes the pod to fail compilation by Raku.

The proper output for the line should be:

=begin code :lang<json>
antononcube commented 2 years ago

I cannot reproduce this:

tbrowder commented 2 years ago

Thanks, I'll look more closely...

tbrowder commented 2 years ago

A better, complete example. Create a Raku program containing the following lines:

 use Markdown::Grammar;
 my $s = q:to/HERE/;
 ```json
 ```
 HERE
 my $p = from-markdown $s, to => 'pod6';
 say $p;

Call the program 'mtest.raku'. Run

$ raku mtest.raku
=begin pod
=begin code json
{
}

=end code

=end pod

For your pod testing it might be helpful to add a test something like this:

lives-ok {
    EVAL $test-pod-from-markdown;
}
antononcube commented 2 years ago

I still cannot reproduce the bug (with the most recent code of this repository.) See the attached screenshot.