--- markdown-1.0.2~b8.orig/ChangeLog
+++ markdown-1.0.2~b8/ChangeLog
@@ -0,0 +1,98 @@
+1.0.2b8 - Wed 09 May 2007
+
+	+	Fixed bug with nested raw HTML tags that contained
+		attributes. The problem is that it uses a backreference in
+		the expression that it passes to gen_extract_tagged, which
+		is broken when Text::Balanced wraps it in parentheses.
+
+		Thanks to Matt Kraai for the patch.
+	
+	+	Now supports URLs containing literal parentheses, such as:
+	
+			http://en.wikipedia.org/wiki/WIMP_(computing)
+		
+		Such parentheses may be arbitrarily nested, but must be
+		balanced.
+
+
+1.0.2b7
+
+	+	Changed shebang line from "/usr/bin/perl" to "/usr/bin/env perl"
+	
+	+	Now only trim trailing newlines from code blocks, instead of trimming
+		all trailing whitespace characters.
+
+
+1.0.2b6 - Mon 03 Apr 2006
+
+	+	Fixed bad performance bug in new `Text::Balanced`-based block-level parser.
+
+
+1.0.2b5 - Thu 08 Dec 2005
+
+	+	Fixed bug where this:
+	
+			[text](http://m.com "title" )
+			
+		wasn't working as expected, because the parser wasn't allowing for spaces
+		before the closing paren.
+
+
+1.0.2b4 - Thu 08 Sep 2005
+
+	+	Filthy hack to support markdown='1' in div tags, because I need it
+		to write today's fireball.
+	
+	+	First crack at a new, smarter, block-level HTML parser.
+
+1.0.2b3 - Thu 28 Apr 2005
+
+	+	_DoAutoLinks() now supports the 'dict://' URL scheme.
+
+	+	PHP- and ASP-style processor instructions are now protected as
+		raw HTML blocks.
+
+			<? ... ?>
+			<% ... %>
+
+	+	Workarounds for regressions introduced with fix for "backticks within
+		tags" bug in 1.0.2b1. The fix is to allow `...` to be turned into
+		<code>...</code> within an HTML tag attribute, and then to turn
+		these spurious `<code>` tags back into literal backtick characters
+		in _EscapeSpecialCharsWithinTagAttributes().
+
+		The regression was caused because in the fix, we moved
+		_EscapeSpecialCharsWithinTagAttributes() ahead of _DoCodeSpans()
+		in _RunSpanGamut(), but that's no good. We need to process code
+		spans first, otherwise we can get tripped up by something like this:
+
+			`<test a="` content of attribute `">`
+
+
+1.0.2b2 - 20 Mar 2005
+
+	+	Fix for nested sub-lists in list-paragraph mode. Previously we got
+		a spurious extra level of `<p>` tags for something like this:
+
+			*	this
+
+				*	sub
+
+				that
+
+	+	Experimental support for [this] as a synonym for [this][].
+		(Note to self: No test yet for this.)
+		Be sure to test, e.g.: [permutations of this sort of [thing][].]
+
+
+1.0.2b1 - 28  Feb 2005
+
+	+	Fix for backticks within HTML tag: <span attr='`ticks`'>like this</span>
+
+	+	Fix for escaped backticks still triggering code spans:
+
+			There are two raw backticks here: \` and here: \`, not a code span
+
+1.0.1 - 14 Dec 2004
+
+1.0 - 28 Aug 2004
--- markdown-1.0.2~b8.orig/Markdown.pl
+++ markdown-1.0.2~b8/Markdown.pl
@@ -8,7 +8,7 @@
 #
 
 
-package Markdown;
+package Text::Markdown;
 require 5.006_000;
 use strict;
 use warnings;
@@ -74,6 +74,9 @@
 # (see _ProcessListItems() for details):
 my $g_list_level = 0;
 
+# Check to see if Markdown.pm has been loaded; if so we must be loaded
+# as a perl module.
+my $g_perl_module = exists $INC{'Text/Markdown.pm'};
 
 #### Blosxom plug-in interface ##########################################
 
@@ -97,8 +100,8 @@
 
 
 #### Movable Type plug-in interface #####################################
-eval {require MT};  # Test to see if we're running in MT.
-unless ($@) {
+eval {require MT} unless $g_perl_module;  # Test to see if we're running in MT.
+unless ($g_perl_module || $@) {
     require MT;
     import  MT;
     require MT::Template::Context;
@@ -188,7 +191,7 @@
 		});
 	}
 }
-else {
+elsif (! $g_perl_module) {
 #### BBEdit/command-line text filter interface ##########################
 # Needs to be hidden from MT (and Blosxom when running in static mode).
 
@@ -199,7 +202,7 @@
 
 		#### Check for command-line switches: #################
 		my %cli_opts;
-		use Getopt::Long;
+		eval {use Getopt::Long}; # don't load in library mode
 		Getopt::Long::Configure('pass_through');
 		GetOptions(\%cli_opts,
 			'version',
@@ -855,6 +858,11 @@
 		  (								# $4
 			  \z
 			|
+			  \n
+			  (?=						# Lookahead for a blockquote
+				[ \t]*>
+			  )
+			|
 			  \n{2,}
 			  (?=\S)
 			  (?!						# Negative lookahead for another list item marker
@@ -1451,14 +1459,15 @@
 
 =head1 NAME
 
-B<Markdown>
+B<markdown>
 
 
 =head1 SYNOPSIS
 
-B<Markdown.pl> [ B<--html4tags> ] [ B<--version> ] [ B<-shortversion> ]
-    [ I<file> ... ]
+B<markdown> [ B<--html4tags> ] [ B<--version> ] [ B<-shortversion> ] [ I<file> ... ]
 
+use Markdown;
+$html=Markdown::Markdown($text);
 
 =head1 DESCRIPTION
 
@@ -1481,7 +1490,7 @@
 
 Use "--" to end switch parsing. For example, to open a file named "-z", use:
 
-	Markdown.pl -- -z
+	markdown -- -z
 
 =over 4
 
@@ -1522,110 +1531,6 @@
 you expected; (3) the output Markdown actually produced.
 
 
-=head1 VERSION HISTORY
-
-See the readme file for detailed release notes for this version.
-
-1.0.2b8 - Wed 09 May 2007
-
-	+	Fixed bug with nested raw HTML tags that contained
-		attributes. The problem is that it uses a backreference in
-		the expression that it passes to gen_extract_tagged, which
-		is broken when Text::Balanced wraps it in parentheses.
-
-		Thanks to Matt Kraai for the patch.
-	
-	+	Now supports URLs containing literal parentheses, such as:
-	
-			http://en.wikipedia.org/wiki/WIMP_(computing)
-		
-		Such parentheses may be arbitrarily nested, but must be
-		balanced.
-
-
-1.0.2b7
-
-	+	Changed shebang line from "/usr/bin/perl" to "/usr/bin/env perl"
-	
-	+	Now only trim trailing newlines from code blocks, instead of trimming
-		all trailing whitespace characters.
-
-
-1.0.2b6 - Mon 03 Apr 2006
-
-	+	Fixed bad performance bug in new `Text::Balanced`-based block-level parser.
-
-
-1.0.2b5 - Thu 08 Dec 2005
-
-	+	Fixed bug where this:
-	
-			[text](http://m.com "title" )
-			
-		wasn't working as expected, because the parser wasn't allowing for spaces
-		before the closing paren.
-
-
-1.0.2b4 - Thu 08 Sep 2005
-
-	+	Filthy hack to support markdown='1' in div tags, because I need it
-		to write today's fireball.
-	
-	+	First crack at a new, smarter, block-level HTML parser.
-
-1.0.2b3 - Thu 28 Apr 2005
-
-	+	_DoAutoLinks() now supports the 'dict://' URL scheme.
-
-	+	PHP- and ASP-style processor instructions are now protected as
-		raw HTML blocks.
-
-			<? ... ?>
-			<% ... %>
-
-	+	Workarounds for regressions introduced with fix for "backticks within
-		tags" bug in 1.0.2b1. The fix is to allow `...` to be turned into
-		<code>...</code> within an HTML tag attribute, and then to turn
-		these spurious `<code>` tags back into literal backtick characters
-		in _EscapeSpecialCharsWithinTagAttributes().
-
-		The regression was caused because in the fix, we moved
-		_EscapeSpecialCharsWithinTagAttributes() ahead of _DoCodeSpans()
-		in _RunSpanGamut(), but that's no good. We need to process code
-		spans first, otherwise we can get tripped up by something like this:
-
-			`<test a="` content of attribute `">`
-
-
-1.0.2b2 - 20 Mar 2005
-
-	+	Fix for nested sub-lists in list-paragraph mode. Previously we got
-		a spurious extra level of `<p>` tags for something like this:
-
-			*	this
-
-				*	sub
-
-				that
-
-	+	Experimental support for [this] as a synonym for [this][].
-		(Note to self: No test yet for this.)
-		Be sure to test, e.g.: [permutations of this sort of [thing][].]
-
-
-1.0.2b1 - 28  Feb 2005
-
-	+	Fix for backticks within HTML tag: <span attr='`ticks`'>like this</span>
-
-	+	Fix for escaped backticks still triggering code spans:
-
-			There are two raw backticks here: \` and here: \`, not a code span
-
-1.0.1 - 14 Dec 2004
-
-1.0 - 28 Aug 2004
-
-
 =head1 AUTHOR
 
     John Gruber
--- markdown-1.0.2~b8.orig/debian/changelog
+++ markdown-1.0.2~b8/debian/changelog
@@ -0,0 +1,63 @@
+markdown (1.0.2~b8-3) experimental; urgency=medium
+
+  * Make the build reproducible, thanks to Chris Lamb, closes: #776925.
+
+ -- Matt Kraai <kraai@debian.org>  Tue, 03 Feb 2015 07:52:13 -0800
+
+markdown (1.0.2~b8-2) experimental; urgency=low
+
+  * Handle a list followed by a blockquote correctly, closes: #424919.
+
+ -- Matt Kraai <kraai@debian.org>  Mon, 11 Jun 2007 21:59:24 -0700
+
+markdown (1.0.2~b8-1) experimental; urgency=low
+
+  * New beta release, closes: #421845.
+  * Remove trailing spaces in debian/changelog and debian/rules.
+  * Remove debian/changelog~ and debian/control~.
+  * Add syntax documentation written by Joey Hess.
+  * Install the upstream changelog and README, closes: #421849.
+
+ -- Matt Kraai <kraai@debian.org>  Wed, 09 May 2007 19:50:43 -0700
+
+markdown (1.0.2~b7-2) experimental; urgency=low
+
+  * Add a binary-arch target.
+  * Change the module name to Text::Markdown.
+
+ -- Matt Kraai <kraai@debian.org>  Mon,  1 Jan 2007 07:59:59 -0800
+
+markdown (1.0.2~b7-1) experimental; urgency=low
+
+  * New beta release, closes: #380212.
+
+ -- Matt Kraai <kraai@debian.org>  Wed, 30 Aug 2006 06:44:25 -0700
+
+markdown (1.0.1-3) unstable; urgency=low
+
+  * Make the clean target in debian/rules remove debian/files, reported by
+    Joey Hess.
+  * Behave as a module if used as one, reported and patched by Joey Hess,
+    closes: #356143.
+  * Change the standards version to 3.6.2.2.
+
+ -- Matt Kraai <kraai@debian.org>  Fri, 10 Mar 2006 04:50:15 -0800
+
+markdown (1.0.1-2) unstable; urgency=low
+
+  * Remove the version history section from the manual page (closes:
+    #285252).
+
+ -- Matt Kraai <kraai@debian.org>  Sun, 19 Dec 2004 23:11:04 -0800
+
+markdown (1.0.1-1) unstable; urgency=low
+
+  * New release.
+
+ -- Matt Kraai <kraai@debian.org>  Sun, 19 Dec 2004 08:29:05 -0800
+
+markdown (1.0-1) unstable; urgency=low
+
+  * Package.
+
+ -- Matt Kraai <kraai@debian.org>  Tue, 19 Oct 2004 05:58:08 -0700
--- markdown-1.0.2~b8.orig/debian/control
+++ markdown-1.0.2~b8/debian/control
@@ -0,0 +1,13 @@
+Source: markdown
+Maintainer: Matt Kraai <kraai@debian.org>
+Section: web
+Priority: optional
+Standards-Version: 3.7.2.1
+
+Package: markdown
+Architecture: all
+Depends: perl (>= 5.6.0-0.1)
+Description: Text-to-HTML conversion tool
+ Markdown is a text-to-HTML conversion tool for web writers.  It
+ allows you to write using an easy-to-read, easy-to-write plain text
+ format, then convert it to structurally valid XHTML (or HTML).
--- markdown-1.0.2~b8.orig/debian/copyright
+++ markdown-1.0.2~b8/debian/copyright
@@ -0,0 +1,36 @@
+The Markdown sources were downloaded from
+http://daringfireball.net/projects/downloads/Markdown_1.0.2b8.tbz.
+
+Markdown was written by John Gruber.  The Debian package was created
+by Matt Kraai.
+
+ Copyright (c) 2004, John Gruber  
+ <http://daringfireball.net/>  
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+ * Neither the name "Markdown" nor the names of its contributors may
+   be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+ This software is provided by the copyright holders and contributors "as
+ is" and any express or implied warranties, including, but not limited
+ to, the implied warranties of merchantability and fitness for a
+ particular purpose are disclaimed. In no event shall the copyright owner
+ or contributors be liable for any direct, indirect, incidental, special,
+ exemplary, or consequential damages (including, but not limited to,
+ procurement of substitute goods or services; loss of use, data, or
+ profits; or business interruption) however caused and on any theory of
+ liability, whether in contract, strict liability, or tort (including
+ negligence or otherwise) arising in any way out of the use of this
+ software, even if advised of the possibility of such damage.
--- markdown-1.0.2~b8.orig/debian/rules
+++ markdown-1.0.2~b8/debian/rules
@@ -0,0 +1,46 @@
+#!/usr/bin/make -f
+
+binary: binary-indep
+
+binary-arch:
+
+binary-indep:
+	install -d debian/tmp/usr/bin debian/tmp/usr/share/perl5/Text
+	install Markdown.pl debian/tmp/usr/bin/markdown
+	ln -sf ../../../bin/markdown \
+	   debian/tmp/usr/share/perl5/Text/Markdown.pm
+
+	install -d debian/tmp/usr/share/man/man1
+	install -d debian/tmp/usr/share/man/man3
+	install -m 644 markdown.1 debian/tmp/usr/share/man/man1/markdown.1
+	gzip -9n debian/tmp/usr/share/man/man1/markdown.1
+	ln -sf ../man1/markdown.1.gz \
+		debian/tmp/usr/share/man/man3/Markdown.3.gz
+
+	install -d debian/tmp/usr/share/doc/markdown
+	install -m 644 ChangeLog debian/tmp/usr/share/doc/markdown/changelog
+	gzip -9n debian/tmp/usr/share/doc/markdown/changelog
+	install -m 644 Markdown\ Readme.text \
+		debian/tmp/usr/share/doc/markdown/README
+	install -m 644 debian/changelog \
+		debian/tmp/usr/share/doc/markdown/changelog.Debian
+	gzip -9n debian/tmp/usr/share/doc/markdown/changelog.Debian
+	install -m 644 debian/copyright \
+		debian/tmp/usr/share/doc/markdown/copyright
+	install -m 644 debian/syntax debian/tmp/usr/share/doc/markdown
+
+	install -d debian/tmp/DEBIAN
+	dpkg-gencontrol -isp
+	dpkg-deb --build debian/tmp ..
+
+build: build-indep
+
+build-indep: markdown.1
+
+clean:
+	rm -fr debian/files debian/tmp markdown.1
+
+markdown.1: Markdown.pl
+	pod2man Markdown.pl > markdown.1
+
+.PHONY: binary binary-arch binary-indep build clean
--- markdown-1.0.2~b8.orig/debian/syntax
+++ markdown-1.0.2~b8/debian/syntax
@@ -0,0 +1,52 @@
+Markdown uses a form very close to how you might write text for an email
+message. It works like this:
+
+Leave blank lines between paragraphs.
+
+You can **emphasise** or ****strongly emphasise**** text by placing it
+in single or double asterisks.
+
+To create a list, start each line with an asterisk:
+
+* this is my list
+* another item
+
+To make a numbered list, start each line with a number (any number will
+do) followed by a period:
+
+1. first line
+2. second line
+2. third line
+
+To create a header, start a line with one or more `#` characters followed
+by a space and the header text. The number of `#` characters controls the
+size of the header:
+
+# h1
+## h2
+### h3
+#### h4
+##### h5
+###### h6
+
+To create a horizontal rule, just write three or more dashes or stars on
+their own line:
+
+----
+
+To quote someone, prefix the quote with ">":
+
+> To be or not to be,
+> that is the question.
+
+To write a code block, indent each line with a tab or 4 spaces:
+
+    10 PRINT "Hello, world!"
+    20 GOTO 10
+
+To link to another web page, or to an email address, you can just put the
+url in angle brackets: <http://example.com/>, or you can use the
+form [example link text](http://example.com)
+
+For complete documentation of markdown syntax, see
+<http://daringfireball.net/projects/markdown/syntax>.
