CommonMark::Parser(3)
π CommonMark::Parser π
ok so bestie, welcome to CommonMark::Parser β that's the module name, and it lives in the Perl man pages (section 3, for the nerds keeping track π). It's a push parser interface, and honestly? it's giving β¨main character energyβ¨ for anyone who wants to feed Markdown in little chunks instead of all at once.
β¨ SYNOPSIS β¨
my $parser = CommonMark::Parser->new;
$parser->feed($string);
$parser->feed($another_string);
my $doc = $parser->finish;
that's it. that's the whole vibe. feed it, feed it again, then finish and boom π
πΈ DESCRIPTION πΈ
CommonMark::Parser hands you a push parser interface to parse CommonMark documents. so instead of dumping your whole document at it and hoping for the best, you push bits of it in whenever you feel like it. iconic behaviour, no cap π¦
π new
my $parser = CommonMark::Parser->new( [$options] );
makes you a shiny new parser object π«Ά
$options is a bit field holding the parser options. if you don't pass anything, it defaults to zero, which is OPT_DEFAULT. and if you wanna know what all those options actually are, go peek at "Parser options" in CommonMark. iykyk π
π§ feed
$parser->feed($string);
feeds a part of the input Markdown to the parser. that's the whole job. one bite at a time, bestie π
π finish
my $doc = $parser->finish;
this one parses a CommonMark document out of all the strings you added with feed, and it returns the CommonMark::Node of the document root. the moment we've all been waiting for, fr fr π
π COPYRIGHT π
this software is copyright (C) by Nick Wellnhofer. respect the icon π
it's free software β you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, open source, we love to see it πΈ
and that's the page, bestie π this was CommonMark::Parser(3) from the User Contributed Perl Documentation, generated by perl v5.42.0, dated 2025-07-25. go feed a parser something nice β¨π
π¦ where this page comes from
- fedora 43: perl-CommonMark 0.310100-4.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms