use HTML::WikiConverter; local $/; require 't/runtests.pl'; runtests( data => , dialect => 'Markdown', wiki_uri => 'http://www.test.com/wiki/' ); close DATA; __DATA__ unordered list __H__ __W__ * one * two * three __NEXT__ ordered list __H__
  1. one
  2. two
  3. three
__W__ 1. one 2. two 3. three __NEXT__ blockquote __H__
text
__W__ > text __NEXT__ nested blockquote __H__
text
text2
__W__ > text > > > text2 __NEXT__ nested blockquote cont'd __H__
This is the first level of quoting.
This is nested blockquote.

Back to the first level.

__W__ > This is the first level of quoting. > > > This is nested blockquote. > > Back to the first level. __NEXT__ h1 __H__

text

__W__ # text __NEXT__ bold __H__ bold text __W__ **bold text** __NEXT__ italics __H__ text __W__ _text_ __NEXT__ strong __H__ text __W__ **text** __NEXT__ em __H__ text __W__ _text_ __NEXT__ inline link ::link_style('inline') __H__

It's called LTP.

__W__ It's called [LTP](http://en.wikipedia.org/wiki/Long-term_potentiation Long-term potentiation). __NEXT__ reference link ::link_style('reference') __H__

It's called LTP.

__W__ It's called [LTP][1]. [1]: http://en.wikipedia.org/wiki/Long-term_potentiation "Long-term potentiation" __NEXT__ reference link no title ::link_style('inline') __H__

This link has no title attribute.

__W__ [This link](http://example.net/) has no title attribute. __NEXT__ multi-paragraphs with reference links ::link_style('reference') __H__

This is a paragraph with a link to Google. There's also a link to some other stuff, like Digg and Wikipedia.

Here's another paragraph.

This is fun stuff:

__W__ This is a paragraph with a link to [Google][1]. There's also a link to some other stuff, like [Digg][2] and [Wikipedia][3]. Here's another paragraph. This is fun stuff: * [Google Video is the best!][4] * [Example.org is a close second][5] [1]: http://google.com [2]: http://digg.com [3]: http://wikipedia.org [4]: http://video.google.com "Google Video" [5]: http://www.example.org "Examples" __NEXT__ code __H__ printf() __W__ `printf()` __NEXT__ inline image ::image_style('inline') __H__ Delete __W__ ![Delete](http://example.com/delete.png "Click to delete") __NEXT__ reference image ::image_style('reference') __H__ Delete __W__ ![Delete][1] [1]: http://example.com/delete.png "Click to delete" __NEXT__ mixed inline images and links ::image_style('inline') ::link_style('inline') __H__

Link goes Here. Image goes below:

Logo

__W__ Link goes [Here](http://example.com Link to example.com). Image goes below: ![Logo](http://example.com/logo.png) __NEXT__ mixed reference images and links ::image_style('reference') ::link_style('reference') __H__

This is a paragraph with a link to Google. There's also a link to some other stuff, like Digg and Wikipedia. Delete

__W__ This is a paragraph with a link to [Google][1]. There's also a link to some other stuff, like [Digg][2] and [Wikipedia][3]. ![Delete][4] [1]: http://google.com [2]: http://digg.com [3]: http://wikipedia.org [4]: http://example.com/delete.png "Click to delete" __NEXT__ fallback to tag if image has dimensions ::image_tag_fallback(1) __H__ Thingy __W__ Thingy __NEXT__ no fallback ::image_tag_fallback(0) ::image_style('inline') __H__ Thingy __W__ ![Thingy](http://example.com/origin.png "The title") __NEXT__ automatic links __H__ http://example.com __W__ __NEXT__ escapes __H__

a backslash \

a weird combo ![

a curly brace {

1992. not a list item!

__W__ a backslash \\ a weird combo \![ a curly brace \{ 1992\. not a list item! __NEXT__ multi-headers __H__

One

Two

Three

__W__ # One ## Two ### Three __NEXT__ one-dot lists ::ordered_list_style('one-dot') __H__
  1. one
  2. two
  3. three
__W__ 1. one 1. two 1. three __NEXT__ plus lists ::unordered_list_style('plus') __H__ __W__ + one + two + three __NEXT__ dash lists ::unordered_list_style('dash') __H__ __W__ - one - two - three __NEXT__ forced inline anchors ::force_inline_anchor_links(1) ::unordered_list_style('asterisk') __H__ __W__ * [Overview](#overview) * [Philosophy](#philosophy) * [Inline HTML](#html) __NEXT__ table __H__
My favorite animals
Animal Region Physical traits Food
Pacman frog Gran Chaco (Argentina) Half mouth, half stomach (quite literally!) Crickets, fish, etc.
__W__
My favorite animals
Animal Region Physical traits Food
Pacman frog Gran Chaco (Argentina) Half mouth, half stomach (quite literally!) Crickets, fish, etc.
__NEXT__ setext header ::header_style('setext') __H__

header1

Fun stuff here.

header2

More fun stuff!

__W__ header1 ======= Fun stuff here. header2 ------- More fun stuff! __NEXT__ more complete example ::header_style('atx') __H__

Aaron Swartz's html2text

A handful of people have asked if there's a way to translate Markdown in reverse — to turn HTML back into Markdown-formatted plain text. The short answer is yes, by using Aaron Swartz's new version of html2text:

html2text is a Python script that convers a page of HTML into clean, easy-to-read plain ASCII. Better yet, that ASCII also happens to be valid Markdown (a text-to-HTML format).

html2text works so well that I'm planning to use it to convert most of my old Daring Fireball articles (the ones I wrote in raw HTML). It's worth noting that if you start with a Markdown document, translate it to HTML, then use html2text to go back to Markdown, it won't give you the exact same document you started with. That sort of complete round-trip fidelity simply is not possible, but html2text comes pretty close.

Also, much like Markdown and SmartyPants, html2text works as a BBEdit text filter. Simply save a copy in the Unix Filters folder in your BBEdit Support folder.

__W__ ## Aaron Swartz's html2text A handful of people have asked if there's a way to translate Markdown in reverse — to turn HTML back into Markdown-formatted plain text. The short answer is yes, by using Aaron Swartz's new version of [html2text][1]: > html2text is a Python script that convers a page of HTML into clean, easy-to-read plain ASCII. Better yet, that ASCII also happens to be valid Markdown (a text-to-HTML format). html2text works so well that I'm planning to use it to convert most of my old Daring Fireball articles (the ones I wrote in raw HTML). It's worth noting that if you start with a Markdown document, translate it to HTML, then use html2text to go back to Markdown, it won't give you the exact same document you started with. That sort of complete round-trip fidelity simply is not possible, but html2text comes pretty close. Also, much like Markdown and SmartyPants, html2text works as a BBEdit text filter. Simply save a copy in the Unix Filters folder in your BBEdit Support folder. [1]: http://www.aaronsw.com/2002/html2text/ __NEXT__ blockquotes containing only phrasal elements __H__

Via Wikipedia:

Long-term potentiation is the long-lasting enhancement in communication between two neurons that lasts from minutes to hours.

Sweet.

__W__ Via [Wikipedia][1]: > Long-term potentiation is the long-lasting enhancement in communication between two [neurons][2] that lasts from minutes to hours. Sweet. [1]: http://en.wikipedia.org/wiki/Long-term_potentiation [2]: http://en.wikipedia.org/wiki/Neuron __NEXT__ blockquote containing p __H__

shouldn't add a paragraph parent

__W__ > shouldn't add a paragraph parent __NEXT__ __H__
unmarked paragraph

another paragraph

yet another

__W__ > unmarked paragraph > > another paragraph > > yet another __NEXT__ code containing backticks (bug #43998) __H__

There is a literal backtick (`) here.

__W__ ``There is a literal backtick (`) here.`` __NEXT__ amp, lt, gt within code blocks (bug #43996) __H__ print("a < b") if $c > $d __W__ `print("a < b") if $c > $d` __NEXT__ amp, lt, gt within code blocks (bug #43996, example from markdown docs, http://bit.ly/NSrG3) __H__

I strongly recommend against using any <blink> tags.

I wish SmartyPants used named entities like &mdash; instead of decimal-encoded entites like &#8212;.

__W__ I strongly recommend against using any `` tags. I wish SmartyPants used named entities like `—` instead of decimal-encoded entites like `—`. __NEXT__ escape literal backticks outside of tags __H__

Hi there, this is a backtick (`).

__W__ Hi there, this is a backtick (\`). __NEXT__ don't backslash-escape underscores within tags (bug #43993) __H__ foo _bar_ baz foo_bar __W__ `foo _bar_ baz foo_bar` __NEXT__ but do backslash-escape other underscores __H__

foo _bar_

__W__ foo \_bar\_ __NEXT__ code blocks __H__

Here's an example:

if( chomp( my $foo = <> ) ) {
  print "entered: $foo\n";
}
__W__ Here's an example: if( chomp( my $foo = <> ) ) { print "entered: $foo\n"; } __NEXT__ code blocks __H__
if( chomp( my $foo = <> ) ) {
  print "entered: $foo\n";
}
__W__ if( chomp( my $foo = <> ) ) { print "entered: $foo\n"; }