diff --git a/nashorn/make/build.xml b/nashorn/make/build.xml
index bb5f6b33af2..93342248de5 100644
--- a/nashorn/make/build.xml
+++ b/nashorn/make/build.xml
@@ -304,6 +304,10 @@ grant codeBase "file:/${basedir}/test/script/basic/classloader.js" {
permission java.lang.RuntimePermission "nashorn.JavaReflection";
};
+grant codeBase "file:/${basedir}/test/script/markdown.js" {
+ permission java.io.FilePermission "${basedir}/test/script/external/showdown/-", "read";
+};
+
\/
@@ -319,6 +323,7 @@ grant codeBase "file:/${basedir}/test/script/basic/classloader.js" {
+
@@ -399,6 +404,25 @@ grant codeBase "file:/${basedir}/test/script/basic/classloader.js" {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -546,6 +570,11 @@ grant codeBase "file:/${basedir}/test/script/basic/classloader.js" {
+
+
+
+
+
diff --git a/nashorn/make/project.properties b/nashorn/make/project.properties
index 341f4302e4b..ad36744836b 100644
--- a/nashorn/make/project.properties
+++ b/nashorn/make/project.properties
@@ -122,6 +122,7 @@ test.external.dir=test/script/external
test262.dir=${test.external.dir}/test262
test262.suite.dir=${test262.dir}/test/suite
testjfx.dir=${test.script.dir}/jfx
+testmarkdown.dir=${test.script.dir}/markdown
test-sys-prop.test.dir=${test.dir}
test-sys-prop.test.js.roots=${test.basic.dir} ${test.error.dir} ${test.sandbox.dir} ${test.trusted.dir}
@@ -212,6 +213,16 @@ test262-test-sys-prop.test.js.framework=\
${test262.dir}/test/harness/framework.js \
${test262.dir}/test/harness/sta.js
+# testmarkdown test root
+testmarkdown-test-sys-prop.test.js.roots=${testmarkdown.dir}
+
+# execute testmarkdown tests in shared nashorn context or not?
+testmarkdown-test-sys-prop.test.js.shared.context=false
+
+# framework root for markdown script tests
+testmarkdown-test-sys-prop.test.js.framework=\
+ ${test.script.dir}${file.separator}markdown.js
+
# testjfx test root
testjfx-test-sys-prop.test.js.roots=${testjfx.dir}
diff --git a/nashorn/test/script/markdown.js b/nashorn/test/script/markdown.js
new file mode 100644
index 00000000000..c2ba57c9b25
--- /dev/null
+++ b/nashorn/test/script/markdown.js
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Base library for Showdown markdown engine Nashorn testing.
+ * @subtest
+ *
+ *
+ */
+
+load(__DIR__ + "external/showdown/showdown.js");
+var shdwn = Showdown;
+var window = {
+ Showdown: shdwn
+}
+load(__DIR__ + "external/showdown/table.js");
+var converter = new Showdown.converter({extensions: ['table']});
+
diff --git a/nashorn/test/script/markdown/anchors-by-reference.js b/nashorn/test/script/markdown/anchors-by-reference.js
new file mode 100644
index 00000000000..ea284fcd655
--- /dev/null
+++ b/nashorn/test/script/markdown/anchors-by-reference.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nThis is [an example][id] reference-style link.\nThis is [another] [foo] reference-style link.\nThis is [a third][bar] reference-style link.\nThis is [a fourth][4] reference-style link.\n\n [id]: http://example.com/ \"Optional Title Here\"\n [foo]: http://example.com/ (Optional Title Here)\n [bar]: http://example.com/ (Optional Title Here)\n [4]: \n \"Optional Title Here\"";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/anchors-by-reference.js.EXPECTED b/nashorn/test/script/markdown/anchors-by-reference.js.EXPECTED
new file mode 100644
index 00000000000..6115d50e302
--- /dev/null
+++ b/nashorn/test/script/markdown/anchors-by-reference.js.EXPECTED
@@ -0,0 +1,4 @@
+
This is an example reference-style link.
+This is another reference-style link.
+This is a third reference-style link.
+This is a fourth reference-style link.
diff --git a/nashorn/test/script/markdown/automatic-anchors.js b/nashorn/test/script/markdown/automatic-anchors.js
new file mode 100644
index 00000000000..d34ce77f317
--- /dev/null
+++ b/nashorn/test/script/markdown/automatic-anchors.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/automatic-anchors.js.EXPECTED b/nashorn/test/script/markdown/automatic-anchors.js.EXPECTED
new file mode 100644
index 00000000000..6de71a9d275
--- /dev/null
+++ b/nashorn/test/script/markdown/automatic-anchors.js.EXPECTED
@@ -0,0 +1 @@
+
diff --git a/nashorn/test/script/markdown/blockquote-nested-markdown.js b/nashorn/test/script/markdown/blockquote-nested-markdown.js
new file mode 100644
index 00000000000..818ea0f32dc
--- /dev/null
+++ b/nashorn/test/script/markdown/blockquote-nested-markdown.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "> ## This is a header.\n>\n> 1. This is the first list item.\n> 2. This is the second list item.\n>\n> Here's some example code:\n>\n> return shell_exec(\"echo $input | $markdown_script\");";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/blockquote-nested-markdown.js.EXPECTED b/nashorn/test/script/markdown/blockquote-nested-markdown.js.EXPECTED
new file mode 100644
index 00000000000..b32199cead1
--- /dev/null
+++ b/nashorn/test/script/markdown/blockquote-nested-markdown.js.EXPECTED
@@ -0,0 +1,13 @@
+
diff --git a/nashorn/test/script/markdown/blockquote.js b/nashorn/test/script/markdown/blockquote.js
new file mode 100644
index 00000000000..7167a911a05
--- /dev/null
+++ b/nashorn/test/script/markdown/blockquote.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = " \n > This is a multi line blockquote test\n >\n > With more than one line.";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/blockquote.js.EXPECTED b/nashorn/test/script/markdown/blockquote.js.EXPECTED
new file mode 100644
index 00000000000..c4956bbe5cf
--- /dev/null
+++ b/nashorn/test/script/markdown/blockquote.js.EXPECTED
@@ -0,0 +1,5 @@
+
+
This is a multi line blockquote test
+
+
With more than one line.
+
diff --git a/nashorn/test/script/markdown/code-block-html-escape.js b/nashorn/test/script/markdown/code-block-html-escape.js
new file mode 100644
index 00000000000..dff9329f38f
--- /dev/null
+++ b/nashorn/test/script/markdown/code-block-html-escape.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nThis is some HTML:\n\n
diff --git a/nashorn/test/script/markdown/code-block.js b/nashorn/test/script/markdown/code-block.js
new file mode 100644
index 00000000000..e4c7413aaf3
--- /dev/null
+++ b/nashorn/test/script/markdown/code-block.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nThis is a normal paragraph:\n\n This is a code block.";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/code-block.js.EXPECTED b/nashorn/test/script/markdown/code-block.js.EXPECTED
new file mode 100644
index 00000000000..3e56099735f
--- /dev/null
+++ b/nashorn/test/script/markdown/code-block.js.EXPECTED
@@ -0,0 +1,4 @@
+
This is a normal paragraph:
+
+
This is a code block.
+
diff --git a/nashorn/test/script/markdown/doubline-list.js b/nashorn/test/script/markdown/doubline-list.js
new file mode 100644
index 00000000000..4a5736c9472
--- /dev/null
+++ b/nashorn/test/script/markdown/doubline-list.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n * Bird\n\n * Magic";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/doubline-list.js.EXPECTED b/nashorn/test/script/markdown/doubline-list.js.EXPECTED
new file mode 100644
index 00000000000..1065a44547e
--- /dev/null
+++ b/nashorn/test/script/markdown/doubline-list.js.EXPECTED
@@ -0,0 +1,4 @@
+
+
Bird
+
Magic
+
diff --git a/nashorn/test/script/markdown/emphasis.js b/nashorn/test/script/markdown/emphasis.js
new file mode 100644
index 00000000000..b9db46cdda4
--- /dev/null
+++ b/nashorn/test/script/markdown/emphasis.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n*important*\n\n_important_\n\nthis mid*important*sentence";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/emphasis.js.EXPECTED b/nashorn/test/script/markdown/emphasis.js.EXPECTED
new file mode 100644
index 00000000000..a1fda4ab651
--- /dev/null
+++ b/nashorn/test/script/markdown/emphasis.js.EXPECTED
@@ -0,0 +1,5 @@
+
important
+
+
important
+
+
this midimportantsentence
diff --git a/nashorn/test/script/markdown/escaped-number-period.js b/nashorn/test/script/markdown/escaped-number-period.js
new file mode 100644
index 00000000000..5f477449af1
--- /dev/null
+++ b/nashorn/test/script/markdown/escaped-number-period.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "It happened in 1986\. What a great season.";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/escaped-number-period.js.EXPECTED b/nashorn/test/script/markdown/escaped-number-period.js.EXPECTED
new file mode 100644
index 00000000000..0ea83bac1bd
--- /dev/null
+++ b/nashorn/test/script/markdown/escaped-number-period.js.EXPECTED
@@ -0,0 +1 @@
+
It happened in 1986. What a great season.
diff --git a/nashorn/test/script/markdown/escaping.js b/nashorn/test/script/markdown/escaping.js
new file mode 100644
index 00000000000..077df7ecfcb
--- /dev/null
+++ b/nashorn/test/script/markdown/escaping.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nThese should all be escaped:\n\n\\\n\n\`\n\n\*\n\n\_\n\n\{\n\n\}\n\n\[\n\n\]\n\n\(\n\n\)\n\n\#\n\n\+\n\n\-\n\n\.\n\n\!";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/escaping.js.EXPECTED b/nashorn/test/script/markdown/escaping.js.EXPECTED
new file mode 100644
index 00000000000..1ac6a291997
--- /dev/null
+++ b/nashorn/test/script/markdown/escaping.js.EXPECTED
@@ -0,0 +1,31 @@
+
These should all be escaped:
+
+
\
+
+
`
+
+
*
+
+
_
+
+
{
+
+
}
+
+
[
+
+
]
+
+
(
+
+
)
+
+
#
+
+
+
+
+
-
+
+
.
+
+
!
diff --git a/nashorn/test/script/markdown/github-style-at-start.js b/nashorn/test/script/markdown/github-style-at-start.js
new file mode 100644
index 00000000000..0a99bec2b51
--- /dev/null
+++ b/nashorn/test/script/markdown/github-style-at-start.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "```\nfunction MyFunc(a) {\n // ...\n}\n```\n\nThat is some code!";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/github-style-at-start.js.EXPECTED b/nashorn/test/script/markdown/github-style-at-start.js.EXPECTED
new file mode 100644
index 00000000000..4f119a7697a
--- /dev/null
+++ b/nashorn/test/script/markdown/github-style-at-start.js.EXPECTED
@@ -0,0 +1,6 @@
+
function MyFunc(a) {
+ // ...
+}
+
+
+
That is some code!
diff --git a/nashorn/test/script/markdown/github-style-codeblock.js b/nashorn/test/script/markdown/github-style-codeblock.js
new file mode 100644
index 00000000000..32341892605
--- /dev/null
+++ b/nashorn/test/script/markdown/github-style-codeblock.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nDefine a function in javascript:\n\n```\nfunction MyFunc(a) {\n var s = '`';\n}\n```\n\nAnd some HTML\n\n```html\n
diff --git a/nashorn/test/script/markdown/github-style-linebreaks.js b/nashorn/test/script/markdown/github-style-linebreaks.js
new file mode 100644
index 00000000000..c912bee06f9
--- /dev/null
+++ b/nashorn/test/script/markdown/github-style-linebreaks.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "```\ncode can go here\nthis is rendered on a second line\n```";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/github-style-linebreaks.js.EXPECTED b/nashorn/test/script/markdown/github-style-linebreaks.js.EXPECTED
new file mode 100644
index 00000000000..276dbf03cb8
--- /dev/null
+++ b/nashorn/test/script/markdown/github-style-linebreaks.js.EXPECTED
@@ -0,0 +1,3 @@
+
code can go here
+this is rendered on a second line
+
diff --git a/nashorn/test/script/markdown/h1-with-double-hash.js b/nashorn/test/script/markdown/h1-with-double-hash.js
new file mode 100644
index 00000000000..bd965702922
--- /dev/null
+++ b/nashorn/test/script/markdown/h1-with-double-hash.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "# This is an H1 #";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/h1-with-double-hash.js.EXPECTED b/nashorn/test/script/markdown/h1-with-double-hash.js.EXPECTED
new file mode 100644
index 00000000000..ab5b5555dd5
--- /dev/null
+++ b/nashorn/test/script/markdown/h1-with-double-hash.js.EXPECTED
@@ -0,0 +1 @@
+
This is an H1
diff --git a/nashorn/test/script/markdown/h1-with-equals.js b/nashorn/test/script/markdown/h1-with-equals.js
new file mode 100644
index 00000000000..54ee9628f50
--- /dev/null
+++ b/nashorn/test/script/markdown/h1-with-equals.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "This is an H1\n=============";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/h1-with-equals.js.EXPECTED b/nashorn/test/script/markdown/h1-with-equals.js.EXPECTED
new file mode 100644
index 00000000000..ab5b5555dd5
--- /dev/null
+++ b/nashorn/test/script/markdown/h1-with-equals.js.EXPECTED
@@ -0,0 +1 @@
+
This is an H1
diff --git a/nashorn/test/script/markdown/h1-with-single-hash.js b/nashorn/test/script/markdown/h1-with-single-hash.js
new file mode 100644
index 00000000000..3559c22f615
--- /dev/null
+++ b/nashorn/test/script/markdown/h1-with-single-hash.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "# This is an H1";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/h1-with-single-hash.js.EXPECTED b/nashorn/test/script/markdown/h1-with-single-hash.js.EXPECTED
new file mode 100644
index 00000000000..ab5b5555dd5
--- /dev/null
+++ b/nashorn/test/script/markdown/h1-with-single-hash.js.EXPECTED
@@ -0,0 +1 @@
+
This is an H1
diff --git a/nashorn/test/script/markdown/h2-with-dashes.js b/nashorn/test/script/markdown/h2-with-dashes.js
new file mode 100644
index 00000000000..016502f60d4
--- /dev/null
+++ b/nashorn/test/script/markdown/h2-with-dashes.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "This is an H2\n-------------";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/h2-with-dashes.js.EXPECTED b/nashorn/test/script/markdown/h2-with-dashes.js.EXPECTED
new file mode 100644
index 00000000000..375a0d06ba8
--- /dev/null
+++ b/nashorn/test/script/markdown/h2-with-dashes.js.EXPECTED
@@ -0,0 +1 @@
+
This is an H2
diff --git a/nashorn/test/script/markdown/h2-with-double-hash.js b/nashorn/test/script/markdown/h2-with-double-hash.js
new file mode 100644
index 00000000000..246c1701f5d
--- /dev/null
+++ b/nashorn/test/script/markdown/h2-with-double-hash.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "## This is an H2 ##";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/h2-with-double-hash.js.EXPECTED b/nashorn/test/script/markdown/h2-with-double-hash.js.EXPECTED
new file mode 100644
index 00000000000..375a0d06ba8
--- /dev/null
+++ b/nashorn/test/script/markdown/h2-with-double-hash.js.EXPECTED
@@ -0,0 +1 @@
+
This is an H2
diff --git a/nashorn/test/script/markdown/h2-with-single-hash.js b/nashorn/test/script/markdown/h2-with-single-hash.js
new file mode 100644
index 00000000000..d1f7f000c44
--- /dev/null
+++ b/nashorn/test/script/markdown/h2-with-single-hash.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "## This is an H2";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/h2-with-single-hash.js.EXPECTED b/nashorn/test/script/markdown/h2-with-single-hash.js.EXPECTED
new file mode 100644
index 00000000000..375a0d06ba8
--- /dev/null
+++ b/nashorn/test/script/markdown/h2-with-single-hash.js.EXPECTED
@@ -0,0 +1 @@
+
This is an H2
diff --git a/nashorn/test/script/markdown/h3-with-double-hash.js b/nashorn/test/script/markdown/h3-with-double-hash.js
new file mode 100644
index 00000000000..e60e00988cb
--- /dev/null
+++ b/nashorn/test/script/markdown/h3-with-double-hash.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "### This is an H3 ###";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/h3-with-double-hash.js.EXPECTED b/nashorn/test/script/markdown/h3-with-double-hash.js.EXPECTED
new file mode 100644
index 00000000000..13f8c9e7a59
--- /dev/null
+++ b/nashorn/test/script/markdown/h3-with-double-hash.js.EXPECTED
@@ -0,0 +1 @@
+
This is an H3
diff --git a/nashorn/test/script/markdown/h3-with-single-hash.js b/nashorn/test/script/markdown/h3-with-single-hash.js
new file mode 100644
index 00000000000..6af497079d0
--- /dev/null
+++ b/nashorn/test/script/markdown/h3-with-single-hash.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "### This is an H3";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/h3-with-single-hash.js.EXPECTED b/nashorn/test/script/markdown/h3-with-single-hash.js.EXPECTED
new file mode 100644
index 00000000000..13f8c9e7a59
--- /dev/null
+++ b/nashorn/test/script/markdown/h3-with-single-hash.js.EXPECTED
@@ -0,0 +1 @@
+
This is an H3
diff --git a/nashorn/test/script/markdown/h4-with-single-hash.js b/nashorn/test/script/markdown/h4-with-single-hash.js
new file mode 100644
index 00000000000..01bc08e0a58
--- /dev/null
+++ b/nashorn/test/script/markdown/h4-with-single-hash.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "#### This is an H4";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/h4-with-single-hash.js.EXPECTED b/nashorn/test/script/markdown/h4-with-single-hash.js.EXPECTED
new file mode 100644
index 00000000000..165b4ef2f46
--- /dev/null
+++ b/nashorn/test/script/markdown/h4-with-single-hash.js.EXPECTED
@@ -0,0 +1 @@
+
This is an H4
diff --git a/nashorn/test/script/markdown/h5-with-single-hash.js b/nashorn/test/script/markdown/h5-with-single-hash.js
new file mode 100644
index 00000000000..5fe8638bf8b
--- /dev/null
+++ b/nashorn/test/script/markdown/h5-with-single-hash.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "##### This is an H5";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/h5-with-single-hash.js.EXPECTED b/nashorn/test/script/markdown/h5-with-single-hash.js.EXPECTED
new file mode 100644
index 00000000000..28eac14834e
--- /dev/null
+++ b/nashorn/test/script/markdown/h5-with-single-hash.js.EXPECTED
@@ -0,0 +1 @@
+
This is an H5
diff --git a/nashorn/test/script/markdown/h6-with-single-hash.js b/nashorn/test/script/markdown/h6-with-single-hash.js
new file mode 100644
index 00000000000..b1f20f5c8fe
--- /dev/null
+++ b/nashorn/test/script/markdown/h6-with-single-hash.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "###### This is an H6";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/h6-with-single-hash.js.EXPECTED b/nashorn/test/script/markdown/h6-with-single-hash.js.EXPECTED
new file mode 100644
index 00000000000..47574cc5b92
--- /dev/null
+++ b/nashorn/test/script/markdown/h6-with-single-hash.js.EXPECTED
@@ -0,0 +1 @@
+
This is an H6
diff --git a/nashorn/test/script/markdown/horizontal-rules.js b/nashorn/test/script/markdown/horizontal-rules.js
new file mode 100644
index 00000000000..af2cabb91a2
--- /dev/null
+++ b/nashorn/test/script/markdown/horizontal-rules.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n* * *\n\n***\n\n*****\n\n- - -\n\n---------------------------------------\n";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/horizontal-rules.js.EXPECTED b/nashorn/test/script/markdown/horizontal-rules.js.EXPECTED
new file mode 100644
index 00000000000..aaef23eb8bb
--- /dev/null
+++ b/nashorn/test/script/markdown/horizontal-rules.js.EXPECTED
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/nashorn/test/script/markdown/html5-strutural-tags.js b/nashorn/test/script/markdown/html5-strutural-tags.js
new file mode 100644
index 00000000000..3bc4aad54bf
--- /dev/null
+++ b/nashorn/test/script/markdown/html5-strutural-tags.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nThese HTML5 tags should pass through just fine.\n\nhello\nhead\n\n\nread me\n\nread\nme\n\n\nthe end";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/html5-strutural-tags.js.EXPECTED b/nashorn/test/script/markdown/html5-strutural-tags.js.EXPECTED
new file mode 100644
index 00000000000..528731f56ef
--- /dev/null
+++ b/nashorn/test/script/markdown/html5-strutural-tags.js.EXPECTED
@@ -0,0 +1,22 @@
+
diff --git a/nashorn/test/script/markdown/images.js b/nashorn/test/script/markdown/images.js
new file mode 100644
index 00000000000..da2a16a29ff
--- /dev/null
+++ b/nashorn/test/script/markdown/images.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n\n\n\n\n![Alt text][id]\n\n [id]: url/to/image \"Optional title attribute\"";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/images.js.EXPECTED b/nashorn/test/script/markdown/images.js.EXPECTED
new file mode 100644
index 00000000000..7df585521d9
--- /dev/null
+++ b/nashorn/test/script/markdown/images.js.EXPECTED
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/nashorn/test/script/markdown/implicit-anchors.js b/nashorn/test/script/markdown/implicit-anchors.js
new file mode 100644
index 00000000000..ba627fb9cb4
--- /dev/null
+++ b/nashorn/test/script/markdown/implicit-anchors.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nSearch the web at [Google][] or [Daring Fireball][].\n\n [Google]: http://google.com/\n [Daring Fireball]: http://daringfireball.net/";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/implicit-anchors.js.EXPECTED b/nashorn/test/script/markdown/implicit-anchors.js.EXPECTED
new file mode 100644
index 00000000000..01e62d9af84
--- /dev/null
+++ b/nashorn/test/script/markdown/implicit-anchors.js.EXPECTED
@@ -0,0 +1 @@
+
diff --git a/nashorn/test/script/markdown/inline-anchors.js b/nashorn/test/script/markdown/inline-anchors.js
new file mode 100644
index 00000000000..90fe181271c
--- /dev/null
+++ b/nashorn/test/script/markdown/inline-anchors.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nThis is [an example](http://example.com/ \"Title\") inline link.\n\n[This link](http://example.net/) has no title attribute.";
+var output = converter.makeHtml(input);
+print(output);
diff --git a/nashorn/test/script/markdown/inline-anchors.js.EXPECTED b/nashorn/test/script/markdown/inline-anchors.js.EXPECTED
new file mode 100644
index 00000000000..52f90ed319d
--- /dev/null
+++ b/nashorn/test/script/markdown/inline-anchors.js.EXPECTED
@@ -0,0 +1,3 @@
+
diff --git a/nashorn/test/script/markdown/inline-code.js b/nashorn/test/script/markdown/inline-code.js
new file mode 100644
index 00000000000..6ab4f4f657e
--- /dev/null
+++ b/nashorn/test/script/markdown/inline-code.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nCreate a new `function`.\n\nUse the backtick in MySQL syntax ``SELECT `column` FROM whatever``.\n\nA single backtick in a code span: `` ` ``\n\nA backtick-delimited string in a code span: `` `foo` ``\n\nPlease don't use any `