diff --git a/docs/assets/themes/zeppelin/img/docs-img/markdown-example-markdown4j-parser.png b/docs/assets/themes/zeppelin/img/docs-img/markdown-example-markdown4j-parser.png
new file mode 100644
index 00000000000..e3455e31ce3
Binary files /dev/null and b/docs/assets/themes/zeppelin/img/docs-img/markdown-example-markdown4j-parser.png differ
diff --git a/docs/assets/themes/zeppelin/img/docs-img/markdown-example-pegdown-parser.png b/docs/assets/themes/zeppelin/img/docs-img/markdown-example-pegdown-parser.png
new file mode 100644
index 00000000000..21e8bc5bb7c
Binary files /dev/null and b/docs/assets/themes/zeppelin/img/docs-img/markdown-example-pegdown-parser.png differ
diff --git a/docs/assets/themes/zeppelin/img/docs-img/markdown-interpreter-setting.png b/docs/assets/themes/zeppelin/img/docs-img/markdown-interpreter-setting.png
index 7b294e1eb11..33c13ec31ba 100644
Binary files a/docs/assets/themes/zeppelin/img/docs-img/markdown-interpreter-setting.png and b/docs/assets/themes/zeppelin/img/docs-img/markdown-interpreter-setting.png differ
diff --git a/docs/interpreter/markdown.md b/docs/interpreter/markdown.md
index 5aeb6960c92..e5d33d321ad 100644
--- a/docs/interpreter/markdown.md
+++ b/docs/interpreter/markdown.md
@@ -25,14 +25,42 @@ limitations under the License.
## Overview
[Markdown](http://daringfireball.net/projects/markdown/) is a plain text formatting syntax designed so that it can be converted to HTML.
-Apache Zeppelin uses markdown4j. For more examples and extension support, please checkout [here](https://code.google.com/p/markdown4j/).
+Apache Zeppelin uses [markdown4j](https://github.com/jdcasey/markdown4j) and [pegdown](https://github.com/sirthias/pegdown) as markdown parsers.
+
In Zeppelin notebook, you can use ` %md ` in the beginning of a paragraph to invoke the Markdown interpreter and generate static html from Markdown plain text.
-In Zeppelin, Markdown interpreter is enabled by default.
+In Zeppelin, Markdown interpreter is enabled by default and uses the [markdown4j](https://github.com/jdcasey/markdown4j) parser.
+## Configuration
+
| Name | +Default Value | +Description | +
|---|---|---|
| markdown.parser.type | +markdown4j | +Markdown Parser Type. Available values: markdown4j, pegdown. |
+
+
+### Markdown4j Parser
+
+`markdown4j` parser provides [YUML](http://yuml.me/) and [Websequence](https://www.websequencediagrams.com/) extensions
+
+
+
+### Pegdown Parser
+
+`pegdown` parser provides github flavored markdown.
+
+
diff --git a/markdown/pom.xml b/markdown/pom.xml
index 9a24b2cbbca..6f25f3e8e1e 100644
--- a/markdown/pom.xml
+++ b/markdown/pom.xml
@@ -40,6 +40,11 @@
This is deleted text
This is deleted text
This is deleted text
This is italics text
"), result.message()); + } + + @Test + public void testStrongEmphasis() { + InterpreterResult result = md.interpret("This is **strong emphasis** text", null); + assertEquals( + wrapWithMarkdownClassDiv("This is strong emphasis text
"), + result.message()); + } + + @Test + public void testOrderedList() { + String input = + new StringBuilder() + .append("1. First ordered list item\n") + .append("2. Another item") + .toString(); + + String expected = + new StringBuilder() + .append("I’m an inline-style link with title
\n") + .append( + "\n") + .append( + "I’m a relative reference to a repository file
\n") + .append( + "You can use numbers for reference-style link definitions
\n") + .append( + "Or leave it empty and use the link text itself.
\n") + .append( + "URLs and URLs in angle brackets will automatically get turned into links.
http://www.example.com or http://www.example.com and sometimes
example.com (but not on Github, for example).
Some text to show that the reference links can follow later.
") + .toString(); + + InterpreterResult result = md.interpret(input, null); + assertEquals(wrapWithMarkdownClassDiv(expected), result.message()); + } + + @Test + public void testInlineCode() { + InterpreterResult result = md.interpret("Inline `code` has `back-ticks around` it.", null); + assertEquals( + wrapWithMarkdownClassDiv( + "Inline code has back-ticks around it.
\n" + + ""), + r1.message()); + + InterpreterResult r2 = + md.interpret( + "> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **MarkdownInterpreter** into a blockquote. ", + null); + assertEquals( + wrapWithMarkdownClassDiv( + "Blockquotes are very handy in email to emulate reply text.
\n" + + "
This line is part of the same quote.
\n" + + ""), + r2.message()); + } + + @Test + public void testSimpleTable() { + String input = + new StringBuilder() + .append("MarkdownInterpreter | Less | Pretty\n") + .append("--- | --- | ---\n") + .append("*Still* | `renders` | **nicely**\n") + .append("1 | 2 | 3") + .toString(); + + String expected = + new StringBuilder() + .append("This is a very long line that will still be quoted properly when it wraps. Oh boy let’s keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can put MarkdownInterpreter into a blockquote.
\n" + + "
| MarkdownInterpreter | \n") + .append("Less | \n") + .append("Pretty | \n") + .append("
|---|---|---|
| Still | \n") + .append("renders | \n")
+ .append(" nicely | \n") + .append("
| 1 | \n") + .append("2 | \n") + .append("3 | \n") + .append("
| First Header | \n") + .append("Second Header | \n") + .append("Third Header | \n") + .append("
|---|---|---|
| First row | \n") + .append("Data | \n") + .append("Very long data entry | \n") + .append("
| Second row | \n") + .append("Cell | \n") + .append("Cell | \n") + .append("