Text::HTML::Turndown(3)

NAME
Text::HTML::Turndown - convert HTML to Markdown

SYNOPSIS
  use Text::HTML::Turndown;
  my $convert = Text::HTML::Turndown->new();
  my $markdown = $convert->turndown(<<'HTML');
    <h1>Hello world!</h1>
  HTML
  # Hello world!
  # ------------

This is an adapation of the "turndown" libraries.

FUNCTIONS

  "html2markdown"
    use Text::HTML::Turndown 'html2markdown';
    my $frontmatter = html2markdown( $html, %frontmatter_defaults );
    say $frontmatter->document_string;

Converts an HTML string to a Text::FrontMatter::YAML object. The HTML string is assumed to contain UTF-8 octets.

MARKDOWN FLAVOURS / FEATURES

COMPATIBILITY
This port aims to be compatible with the Javascript code and uses the same test suite. But the original library does not pass its tests and the Joplin part does not use the original tests.

Table headers
    For Github flavoured markdown, Joplin aims to always force table headers in markdown. This libary does not (yet).

SEE ALSO
The original library (unmaintained):

<https://github.com/mixmark-io/turndown/>

The Joplin library (maintained):

<https://github.com/laurent22/joplin/tree/dev/packages/turndown>

<https://github.com/laurent22/joplin/tree/dev/packages/turndown-plugin-gfm>

REPOSITORY
The public repository of this module is <https://github.com/Corion/Text-HTML-Turndown>.

SUPPORT
The public support forum of this module is <https://perlmonks.org/>.

BUG TRACKER
Please report bugs in this module via the Github bug queue at <https://github.com/Corion/Text-HTML-Turndown/issues>

AUTHOR
Max Maischein "corion@cpan.org"

COPYRIGHT (c)
Copyright 2025- by Max Maischein "corion@cpan.org".

LICENSE
This module is released under the Artistic License 2.0.