<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,7 @@
 == Since Mislav forked the project from SVN
 
-  * converted tests to specs, cleaner suite
-  * break lib/bluecloth.rb into submodules under lib/transform/
+  * bin/bluecloth doesn't add &lt;html&gt;&lt;body&gt; tags by default; instead it's opt-in
   * deleted legacy files (tests/, test.rb, docs/, experiments/, install.rb, ...)
+  * break lib/bluecloth.rb into submodules under lib/transform/
+  * converted tests to specs, cleaner suite
   * import latest original Markdown.pl for reference (and testing)</diff>
      <filename>CHANGES</filename>
    </modified>
    <modified>
      <diff>@@ -1,47 +1,38 @@
 #!/usr/bin/ruby
-#
-# = bluecloth
-#
 # Format one or more text files with the markdown formatter.
 #
-# = Synopsis
-#
 #   bluecloth [OPTIONS] [FILES]
 #
-# 
-#
-
-BEGIN {
-	require 'bluecloth'
-	require 'optparse'
-}
-
-DocumentWrapper = %{
-&lt;html&gt;
-  &lt;head&gt;&lt;title&gt;%s&lt;/title&gt;&lt;/head&gt;
+require 'optparse'
+$:.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
+require 'bluecloth'
+
+DocumentWrapper = %{&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;%s&lt;/title&gt;
+  &lt;/head&gt;
   &lt;body&gt;
-%s
+    %s
   &lt;/body&gt;
-&lt;/html&gt;
-}
+&lt;/html&gt;}
 
-def main
-	fragment = false
+begin
+	document = false
 	destination = '.'
 
 	ARGV.options do |oparser|
 
-		oparser.banner = &quot;Usage: #$0 [OPTIONS] FILES&quot;
+		oparser.banner = &quot;Usage: $0 [OPTIONS] FILES&quot;
 
 		# Debug mode
 		oparser.on( &quot;--debug&quot;, &quot;-d&quot;, TrueClass, &quot;Turn debugging output on&quot; ) {
 			$DEBUG = true
 		}
 
-		# 'Fragment' mode
-		oparser.on( &quot;--fragment&quot;, &quot;-f&quot;, TrueClass,
-			&quot;Output HTML fragments instead of whole documents&quot; ) {
-			fragment = true
+		# Document mode
+		oparser.on( &quot;--document&quot;, &quot;-c&quot;, TrueClass,
+			&quot;Wrap resulting HTML creating a basic HTML document&quot; ) {
+			document = true
 		}
 
 		# Output destination
@@ -56,28 +47,29 @@ def main
 	# Filter mode if no arguments
 	ARGV.push( &quot;-&quot; ) if ARGV.empty?
 
-	ARGV.each {|file|
-		if file == '-'
-			contents = $stdin.readlines(nil)
-		else
-			contents = File::readlines( file, nil )
-		end
+	ARGV.each do |file|
+		contents = if file == '-'
+        $stdin.read
+      else
+        File::read file
+      end
 
-		bc = BlueCloth::new( contents.join )
+		bc = BlueCloth::new contents
+    html = bc.to_html
 
-		if fragment
-			$stdout.puts bc.to_html
+		out = unless document
+			html
 		else
-			$stdout.puts DocumentWrapper % [ file, bc.to_html ]
+			DocumentWrapper % [
+        file,
+        html.gsub(&quot;\n&quot;, &quot;\n    &quot;) # indent 4 spaces
+      ]
 		end
-	}
+
+    $stdout.puts out
+  end
 
 rescue =&gt; err
 	$stderr.puts &quot;Aborting: Fatal error: %s&quot; % err.message
 	exit 255
 end
-
-
-
-main
-</diff>
      <filename>bin/bluecloth</filename>
    </modified>
    <modified>
      <diff>@@ -150,3 +150,21 @@ _acts_as_ferret_
 --- Should become:
 &lt;p&gt;&lt;em&gt;acts_as_ferret&lt;/em&gt;&lt;/p&gt;
 &gt;&gt;&gt;
+
+# no emphasis when underscores and asterisks are surrounded by spaces
+&lt;&lt;&lt;
+There * is no emphasis * here.
+Also _ no emphasis _ here.
+--- becomes:
+&lt;p&gt;There * is no emphasis * here.
+Also _ no emphasis _ here.&lt;/p&gt;
+&gt;&gt;&gt;
+
+# double asterisks or underscores surrounded by spaces create &lt;em&gt;
+&lt;&lt;&lt;
+This is ** a very weird ** feature.
+I don't think __ this should be __ in.
+--- becomes:
+&lt;p&gt;This is &lt;em&gt;* a very weird *&lt;/em&gt; feature.
+I don't think &lt;em&gt;_ this should be _&lt;/em&gt; in.&lt;/p&gt;
+&gt;&gt;&gt;</diff>
      <filename>spec/samples/emphasis</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2382acb9f10bec86c227fbd576a682d593053802</id>
    </parent>
  </parents>
  <author>
    <name>Mislav Marohni&#263;</name>
    <email>mislav.marohnic@gmail.com</email>
  </author>
  <url>http://github.com/github/bluecloth/commit/7856b7b2ba1bb5a69f6db0e6374ede61d98a6d89</url>
  <id>7856b7b2ba1bb5a69f6db0e6374ede61d98a6d89</id>
  <committed-date>2008-04-26T09:15:21-07:00</committed-date>
  <authored-date>2008-04-26T09:13:07-07:00</authored-date>
  <message>bin/bluecloth doesn't wrap result HTML in &lt;html&gt;&lt;body&gt; tags anymore.
add a couple of more tests to emphasis samples, ensuring every bit of http://daringfireball.net/projects/markdown/syntax has tests in our test suite</message>
  <tree>afd1cd886356fede242d920d8846ef9b4dc5f561</tree>
  <committer>
    <name>Mislav Marohni&#263;</name>
    <email>mislav.marohnic@gmail.com</email>
  </committer>
</commit>
