Text::...rkdown(3pm)
β¨ NAME β¨
Text::Markup::Markdown β the Markdown parser for Text::Markup, bestie π
(also known as the manual page Text::...rkdown(3pm), from the User Contributed Perl Documentation collection, iykyk π)
πΈ SYNOPSIS πΈ
my $html = Text::Markup->new->parse(file => 'README.md');
my $raw = Text::Markup->new->parse(
file => 'README.md',
options => [ raw => 1 ],
);
π DESCRIPTION π
Okay so this is the Markdown parser for Text::Markup, and it's literally doing the most in the best way. Here's the tea: it reads in the file (relying on a BOM β like, it trusts the BOM to tell it what's what), hands it off to Text::Markdown::Discount for the actual parsing, and then returns the generated HTML as an encoded UTF-8 string with an "http-equiv="Content-Type"" element that identifies the encoding as UTF-8. Slay. π₯
The links in question, since you'll wanna peek:
- Markdown β <https://daringfireball.net/projects/markdown/>
- BOM β <https://www.unicode.org/unicode/faq/utf_bom.html#BOM>
π¦ The Extensions It Recognizes π¦
It recognizes files with the following extensions as Markdown, no cap:
.md.mkd.mkdn.mdown.markdown
π Want To Change Which Files It Claims? π
Say less. To change the files it recognizes, load this module directly and pass a regular expression matching the extension(s) you want, like so:
use Text::Markup::Markdown qr{markd?};
π Skeleton Or No Skeleton π
Normally this module returns the output wrapped in a minimal HTML document skeleton β very demure, very put-together. But if you'd like the raw output without the skeleton, you can pass the raw parameter to parse. Main character choice honestly. β¨
π The flags Parameter π
The Text::Markup::Markdown parse method supports an additional parameter, flags, which is a bitmask of Text::Markdown::Discount options. Here's that link, go look:
- Text::Markdown::Discount options β <https://github.com/Songmu/text-markdown-discount/blob/d6b1325/lib/Text/Markdown/Discount.xs#L16-L46>
Use this parameter to replace the default, which is:
MKD_NOHEADER | MKD_TOC | MKD_DLEXTRA | MKD_FENCEDCODE | MKD_EXTRA_FOOTNOTE | MKD_IDANCHOR
fr fr, that's the default bitmask β don't forget it if you're swapping in your own. π
π SEE ALSO π
- National Funk Congress Deadlocked On Get Up/Get Down Issue β <https://www.theonion.com/national-funk-congress-deadlocked-on-get-up-get-down-is-1819565355>
- Markup or Markdown? π€
π«Ά AUTHOR π«Ά
David E. Wheeler <david@justatheory.com> β king behavior π
β COPYRIGHT AND LICENSE β
Copyright (c) 2011-2025 David E. Wheeler. Some Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Periodt. π
And that's the whole page, bestie! This was rendered from perl v5.40.1, dated 2025-12-18, and yes it's still Text::...rkdown(3pm) in the corner π¦ β go forth and parse, you absolute icon πΈπ
β¨
π¦ where this page comes from
- ubuntu resolute: libtext-markup-perl 0.41-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtext-markup-perl 0.41-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms