Sha256: 24ef413fb309855eb9bf11cbeebc79de71823c3710a29c18f2f6b727edf919f8

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

use Test;
use Pod::To::HTML;
plan 3;
my $r;

=begin pod
This ordinary paragraph introduces a code block:

    $this = 1 * code('block');
    $which.is_specified(:by<indenting>);
=end pod

$r = node2html $=pod[0];
ok $r ~~ ms[[
    '<p>' 'This ordinary paragraph introduces a code block:' '</p>'
    '<pre class="pod-block-code">$this = 1 * code(&#39;block&#39;);'
'$which.is_specified(:by&lt;indenting&gt;);</pre>']];

=begin pod
This is an ordinary paragraph

    While this is not
    This is a code block

    =head1 Mumble: "mumble"

    Suprisingly, this is not a code block
        (with fancy indentation too)

But this is just a text. Again

=end pod

$r = node2html $=pod[1];
ok $r ~~ ms[['<p>' 'This is an ordinary paragraph' '</p>'
'<pre class="pod-block-code">While this is not'
'This is a code block</pre>'
'<h1 id="Mumble:_&quot;mumble&quot;">' '<a class="u" href="#___top" title="go to top of document">'
    'Mumble: &quot;mumble&quot;'
'</a>' '</h1>'
'<p>' 'Suprisingly, this is not a code block (with fancy indentation too)' '</p>'
'<p>' 'But this is just a text. Again' '</p>']];

my %*POD2HTML-CALLBACKS = code => sub (:$node, :&default) {
    ok $node.contents ~~ /:i code/, 'Callback called';
}

# say $=pod[0].perl;
pod2html $=pod[0];

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
github-markup-3.0.2 vendor/Pod-To-HTML/t/020-code.t