package markdown_test

import (
	"log"
	"os"

	"github.com/shurcooL/go/markdown"
)

func Example() {
	input := []byte(`Title
=

This is a new paragraph. I wonder    if I have too     many spaces.
What about new paragraph.
But the next one...

  Is really new.

1. Item one.
1. Item TWO.


Final paragraph.
`)

	output, err := markdown.Process("", input, nil)
	if err != nil {
		log.Fatalln(err)
	}

	os.Stdout.Write(output)

	// Output:
	//Title
	//=====
	//
	//This is a new paragraph. I wonder if I have too many spaces. What about new paragraph. But the next one...
	//
	//Is really new.
	//
	//1. Item one.
	//2. Item TWO.
	//
	//Final paragraph.
	//
}

func Example2() {
	input := []byte(`Title
==

Subtitle
---

How about ` + "`this`" + ` and other stuff like *italic*, **bold** and ***super    extra***.
`)

	output, err := markdown.Process("", input, nil)
	if err != nil {
		log.Fatalln(err)
	}

	os.Stdout.Write(output)

	// Output:
	//Title
	//=====
	//
	//Subtitle
	//--------
	//
	//How about `this` and other stuff like *italic*, **bold** and ***super extra***.
	//
}

package markdown_test

import (
	"os"

	"github.com/russross/blackfriday"
	"github.com/shurcooL/go/markdown"
)

func Example() {
	input := []byte(`Title
=

This is a new paragraph. I wonder    if I have too     many spaces.
What about new paragraph.
But the next one...

  Is really new.

1. Item one.
1. Item TWO.


Final paragraph.
`)

	output := blackfriday.Markdown(input, markdown.NewRenderer(), 0)

	os.Stdout.Write(output)

	// Output:
	//Title
	//=====
	//
	//This is a new paragraph. I wonder if I have too many spaces. What about new paragraph. But the next one...
	//
	//Is really new.
	//
	//1. Item one.
	//2. Item TWO.
	//
	//Final paragraph.
	//
}

func Example2() {
	input := []byte(`Title
==

Subtitle
---

How about ` + "`this`" + ` and other stuff like *italic*, **bold** and ***super    extra***.
`)

	output := blackfriday.Markdown(input, markdown.NewRenderer(), 0)

	os.Stdout.Write(output)

	// Output:
	//Title
	//=====
	//
	//Subtitle
	//--------
	//
	//How about `this` and other stuff like *italic*, **bold** and ***super extra***.
	//
}

--- 
+++ 
@@ -1,9 +1,9 @@
 package markdown_test
 
 import (
+	"log"
 	"os"
 
-	"github.com/russross/blackfriday"
 	"github.com/shurcooL/go/markdown"
 )
 
@@ -24,7 +24,10 @@
 Final paragraph.
 `)
 
-	output := blackfriday.Markdown(input, markdown.NewRenderer(), 0)
+	output, err := markdown.Process("", input, nil)
+	if err != nil {
+		log.Fatalln(err)
+	}
 
 	os.Stdout.Write(output)
 
@@ -53,7 +56,10 @@
 How about ` + "`this`" + ` and other stuff like *italic*, **bold** and ***super    extra***.
 `)
 
-	output := blackfriday.Markdown(input, markdown.NewRenderer(), 0)
+	output, err := markdown.Process("", input, nil)
+	if err != nil {
+		log.Fatalln(err)
+	}
 
 	os.Stdout.Write(output)
 
Test high level public API instead of internal.
