From cc452998dc1af441cf3f9c5d0c7287cb5de48c4a Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Sat, 30 May 2009 22:29:56 -0400 Subject: Initial implementation of nose testing. Still some cleanup to do, but this shows the differances between the old and the new. Also left one test failing (unsignificant white space only) to demonstrate what a failing test looks like. --- tests/__init__.py | 44 +++++ tests/base.py | 62 ++++++ tests/extensions-x-abbr/test.cfg | 2 + tests/extensions-x-codehilite/test.cfg | 2 + tests/extensions-x-def_list/markdown-syntax.html | 10 +- tests/extensions-x-def_list/test.cfg | 2 + tests/extensions-x-footnotes/test.cfg | 2 + tests/extensions-x-tables/test.cfg | 2 + tests/extensions-x-toc/syntax-toc.html | 10 +- tests/extensions-x-toc/test.cfg | 2 + tests/extensions-x-wikilinks/test.cfg | 2 + tests/extensions-x-wikilinks/wikilinks.html | 3 + tests/html4/test.cfg | 2 + tests/markdown-test/markdown-syntax.html | 10 +- tests/markdown-test/tabs.html | 4 +- tests/misc/em-around-links.html | 13 +- tests/misc/multi-paragraph-block-quote.html | 2 +- tests/misc/tabs-in-lists.html | 2 +- tests/plugins.py | 113 +++++++++++ tests/safe_mode/test.cfg | 2 + tests/test_apis.py | 234 +++++++++++++++++++++++ tests/util.py | 15 ++ 22 files changed, 513 insertions(+), 27 deletions(-) create mode 100644 tests/__init__.py create mode 100644 tests/base.py create mode 100644 tests/extensions-x-abbr/test.cfg create mode 100644 tests/extensions-x-codehilite/test.cfg create mode 100644 tests/extensions-x-def_list/test.cfg create mode 100644 tests/extensions-x-footnotes/test.cfg create mode 100644 tests/extensions-x-tables/test.cfg create mode 100644 tests/extensions-x-toc/test.cfg create mode 100644 tests/extensions-x-wikilinks/test.cfg create mode 100644 tests/html4/test.cfg create mode 100644 tests/plugins.py create mode 100644 tests/safe_mode/test.cfg create mode 100755 tests/test_apis.py create mode 100644 tests/util.py (limited to 'tests') diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..63ddf5b --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,44 @@ +import os +import markdown +import codecs +import difflib +import nose +import util +from plugins import MdSyntaxError, HtmlOutput, MdSyntaxErrorPlugin +from test_apis import * + +test_dir = os.path.abspath(os.path.dirname(__file__)) + +def normalize(text): + return ['%s\n' % l for l in text.strip().split('\n')] + +def check_syntax(file, config): + input_file = file + ".txt" + input = codecs.open(input_file, encoding="utf-8").read() + output_file = file + ".html" + expected_output = codecs.open(output_file, encoding="utf-8").read() + output = normalize(markdown.markdown(input, + config.get('DEFAULT', 'extensions'), + config.get('DEFAULT', 'safe_mode'), + config.get('DEFAULT', 'output_format'))) + diff = [l for l in difflib.unified_diff(normalize(expected_output), + output, output_file, + 'actual_output.html', n=3)] + if diff: + raise util.MdSyntaxError('Output from "%s" failed to match expected ' + 'output.\n\n%s' % (input_file, ''.join(diff))) + +def test_markdown_syntax(): + for dir_name, sub_dirs, files in os.walk(test_dir): + # Get dir specific config settings. + config = util.CustomConfigParser({'extensions': '', + 'safe_mode': False, + 'output_format': 'xhtml1'}) + config.read(os.path.join(dir_name, 'test.cfg')) + # Loop through files and generate tests. + for file in files: + root, ext = os.path.splitext(file) + if ext == '.txt': + yield check_syntax, os.path.join(dir_name, root), config + +nose.main(addplugins=[HtmlOutput(), MdSyntaxErrorPlugin()]) diff --git a/tests/base.py b/tests/base.py new file mode 100644 index 0000000..9e70996 --- /dev/null +++ b/tests/base.py @@ -0,0 +1,62 @@ +import os, codecs +import markdown +from nose.tools import assert_equal +import difflib +from plugins import MdSyntaxError + +class SyntaxBase: + """ + Generator that steps through all files in a dir and runs each text file + (*.txt) as a seperate unit test. + + Each subclass of SyntaxBase should define `dir` as a string containing the + name of the directory which holds the test files. For example: + + dir = "path/to/mytests" + + A subclass may redefine the `setUp` method to create a custom `Markdown` + instance specific to that batch of tests. + + """ + + dir = "" + + def __init__(self): + self.files = [x.replace(".txt", "") + for x in os.listdir(self.dir) if x.endswith(".txt")] + + def setUp(self): + """ + Create Markdown instance. + + Override this method to create a custom `Markdown` instance assigned to + `self.md`. For example: + + self.md = markdown.Markdown(extensions=["footnotes"], safe_mode="replace") + + """ + self.md = markdown.Markdown() + + def tearDown(self): + """ tearDown is not implemented. """ + pass + + def test_syntax(self): + for file in self.files: + yield self.check_syntax, file + + def check_syntax(self, file): + input_file = os.path.join(self.dir, file + ".txt") + input = codecs.open(input_file, encoding="utf-8").read() + output_file = os.path.join(self.dir, file + ".html") + expected_output = codecs.open(output_file, encoding="utf-8").read() + output = self.normalize(self.md.convert(input)) + diff = [l for l in difflib.unified_diff(self.normalize(expected_output), + output, output_file, + 'actual_output.html', n=3)] + if diff: + #assert False, + raise MdSyntaxError('Output from "%s" failed to match expected output.\n\n%s' % (input_file, ''.join(diff))) + + def normalize(self, text): + return ['%s\n' % l for l in text.strip().split('\n')] diff --git a/tests/extensions-x-abbr/test.cfg b/tests/extensions-x-abbr/test.cfg new file mode 100644 index 0000000..32d437f --- /dev/null +++ b/tests/extensions-x-abbr/test.cfg @@ -0,0 +1,2 @@ +[DEFAULT] +extensions=abbr diff --git a/tests/extensions-x-codehilite/test.cfg b/tests/extensions-x-codehilite/test.cfg new file mode 100644 index 0000000..6ed10a2 --- /dev/null +++ b/tests/extensions-x-codehilite/test.cfg @@ -0,0 +1,2 @@ +[DEFAULT] +extensions=codehilite diff --git a/tests/extensions-x-def_list/markdown-syntax.html b/tests/extensions-x-def_list/markdown-syntax.html index 2f63b4b..038c9d1 100644 --- a/tests/extensions-x-def_list/markdown-syntax.html +++ b/tests/extensions-x-def_list/markdown-syntax.html @@ -484,12 +484,12 @@ on a line by itself:

That is:

The link URL may, optionally, be surrounded by angle brackets:

[id]: <http://example.com/>  "Optional Title Here"
@@ -660,10 +660,10 @@ for links, allowing for two styles: inline and reference.

  • An exclamation mark: !;
  • followed by a set of square brackets, containing the alt -attribute text for the image;
  • + attribute text for the image;
  • followed by a set of parentheses, containing the URL or path to -the image, and an optional title attribute enclosed in double -or single quotes.
  • + the image, and an optional title attribute enclosed in double + or single quotes.

Reference-style image syntax looks like this:

![Alt text][id]
diff --git a/tests/extensions-x-def_list/test.cfg b/tests/extensions-x-def_list/test.cfg
new file mode 100644
index 0000000..c9f352d
--- /dev/null
+++ b/tests/extensions-x-def_list/test.cfg
@@ -0,0 +1,2 @@
+[DEFAULT]
+extensions=def_list
diff --git a/tests/extensions-x-footnotes/test.cfg b/tests/extensions-x-footnotes/test.cfg
new file mode 100644
index 0000000..a5f0818
--- /dev/null
+++ b/tests/extensions-x-footnotes/test.cfg
@@ -0,0 +1,2 @@
+[DEFAULT]
+extensions=footnotes
diff --git a/tests/extensions-x-tables/test.cfg b/tests/extensions-x-tables/test.cfg
new file mode 100644
index 0000000..ce5a83d
--- /dev/null
+++ b/tests/extensions-x-tables/test.cfg
@@ -0,0 +1,2 @@
+[DEFAULT]
+extensions=tables
diff --git a/tests/extensions-x-toc/syntax-toc.html b/tests/extensions-x-toc/syntax-toc.html
index eea5347..3559d45 100644
--- a/tests/extensions-x-toc/syntax-toc.html
+++ b/tests/extensions-x-toc/syntax-toc.html
@@ -461,12 +461,12 @@ on a line by itself:

That is:

  • Square brackets containing the link identifier (optionally -indented from the left margin using up to three spaces);
  • + indented from the left margin using up to three spaces);
  • followed by a colon;
  • followed by one or more spaces (or tabs);
  • followed by the URL for the link;
  • optionally followed by a title attribute for the link, enclosed -in double or single quotes.
  • + in double or single quotes.

The link URL may, optionally, be surrounded by angle brackets:

[id]: <http://example.com/>  "Optional Title Here"
@@ -634,10 +634,10 @@ for links, allowing for two styles: inline and reference.

  • An exclamation mark: !;
  • followed by a set of square brackets, containing the alt -attribute text for the image;
  • + attribute text for the image;
  • followed by a set of parentheses, containing the URL or path to -the image, and an optional title attribute enclosed in double -or single quotes.
  • + the image, and an optional title attribute enclosed in double + or single quotes.

Reference-style image syntax looks like this:

![Alt text][id]
diff --git a/tests/extensions-x-toc/test.cfg b/tests/extensions-x-toc/test.cfg
new file mode 100644
index 0000000..e4bc0fe
--- /dev/null
+++ b/tests/extensions-x-toc/test.cfg
@@ -0,0 +1,2 @@
+[DEFAULT]
+extensions=toc
diff --git a/tests/extensions-x-wikilinks/test.cfg b/tests/extensions-x-wikilinks/test.cfg
new file mode 100644
index 0000000..959f38a
--- /dev/null
+++ b/tests/extensions-x-wikilinks/test.cfg
@@ -0,0 +1,2 @@
+[DEFAULT]
+extensions=wikilinks
diff --git a/tests/extensions-x-wikilinks/wikilinks.html b/tests/extensions-x-wikilinks/wikilinks.html
index 1a38535..a76a693 100644
--- a/tests/extensions-x-wikilinks/wikilinks.html
+++ b/tests/extensions-x-wikilinks/wikilinks.html
@@ -1,5 +1,8 @@
 

Some text with a WikiLink.

A link with white space and_underscores and a empty one.

+

Another with double spaces and double__underscores and +one that has emphasis inside and one with_multiple_underscores +and one that is emphasised.

And a RealLink.

http://example.com/And_A_AutoLink

And a MarkdownLink for diff --git a/tests/html4/test.cfg b/tests/html4/test.cfg new file mode 100644 index 0000000..a3fc498 --- /dev/null +++ b/tests/html4/test.cfg @@ -0,0 +1,2 @@ +[DEFAULT] +output_format=html4 diff --git a/tests/markdown-test/markdown-syntax.html b/tests/markdown-test/markdown-syntax.html index 2f63b4b..038c9d1 100644 --- a/tests/markdown-test/markdown-syntax.html +++ b/tests/markdown-test/markdown-syntax.html @@ -484,12 +484,12 @@ on a line by itself:

That is:

  • Square brackets containing the link identifier (optionally -indented from the left margin using up to three spaces);
  • + indented from the left margin using up to three spaces);
  • followed by a colon;
  • followed by one or more spaces (or tabs);
  • followed by the URL for the link;
  • optionally followed by a title attribute for the link, enclosed -in double or single quotes.
  • + in double or single quotes.

The link URL may, optionally, be surrounded by angle brackets:

[id]: <http://example.com/>  "Optional Title Here"
@@ -660,10 +660,10 @@ for links, allowing for two styles: inline and reference.

  • An exclamation mark: !;
  • followed by a set of square brackets, containing the alt -attribute text for the image;
  • + attribute text for the image;
  • followed by a set of parentheses, containing the URL or path to -the image, and an optional title attribute enclosed in double -or single quotes.
  • + the image, and an optional title attribute enclosed in double + or single quotes.

Reference-style image syntax looks like this:

![Alt text][id]
diff --git a/tests/markdown-test/tabs.html b/tests/markdown-test/tabs.html
index b26391b..3c11f14 100644
--- a/tests/markdown-test/tabs.html
+++ b/tests/markdown-test/tabs.html
@@ -1,11 +1,11 @@
 
  • this is a list item -indented with tabs

    + indented with tabs

  • this is a list item -indented with spaces

    + indented with spaces

Code:

diff --git a/tests/misc/em-around-links.html b/tests/misc/em-around-links.html index 06bfa8e..fafac28 100644 --- a/tests/misc/em-around-links.html +++ b/tests/misc/em-around-links.html @@ -1,16 +1,13 @@

Title

- -

Python in Markdown by some - great folks - This does work as expected.

- +great folks
- This does work as expected.

\ No newline at end of file diff --git a/tests/misc/multi-paragraph-block-quote.html b/tests/misc/multi-paragraph-block-quote.html index e13986a..f01b5e4 100644 --- a/tests/misc/multi-paragraph-block-quote.html +++ b/tests/misc/multi-paragraph-block-quote.html @@ -1,6 +1,6 @@

This is line one of paragraph one - This is line two of paragraph one

+This is line two of paragraph one

This is line one of paragraph two

This is another blockquote.

\ No newline at end of file diff --git a/tests/misc/tabs-in-lists.html b/tests/misc/tabs-in-lists.html index a1a92ec..fdb7cb6 100644 --- a/tests/misc/tabs-in-lists.html +++ b/tests/misc/tabs-in-lists.html @@ -19,7 +19,7 @@

Now a list with 4 spaces and some text:

  • A -abcdef
  • + abcdef
  • B

Now with a tab and an extra space:

diff --git a/tests/plugins.py b/tests/plugins.py new file mode 100644 index 0000000..d0cb7f8 --- /dev/null +++ b/tests/plugins.py @@ -0,0 +1,113 @@ +import traceback +from util import MdSyntaxError +from nose.plugins import Plugin +from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin + +class MdSyntaxErrorPlugin(ErrorClassPlugin): + """ Add MdSyntaxError and ensure proper formatting. """ + mdsyntax = ErrorClass(MdSyntaxError, label='MdSyntaxError', isfailure=True) + enabled = True + + def configure(self, options, conf): + self.conf = conf + + def addError(self, test, err): + """ Ensure other plugins see the error by returning nothing here. """ + pass + + def formatError(self, test, err): + """ Remove unnessecary and unhelpful traceback from error report. """ + et, ev, tb = err + if et.__name__ == 'MdSyntaxError': + return et, ev, '' + return err + + +def escape(html): + """ Escape HTML for display as source within HTML. """ + html = html.replace('&', '&') + html = html.replace('<', '<') + html = html.replace('>', '>') + return html + + +class HtmlOutput(Plugin): + """Output test results as ugly, unstyled html. """ + + name = 'html-output' + score = 2 # run late + enabled = True + + def __init__(self): + super(HtmlOutput, self).__init__() + self.html = [ '', + 'Test output', + '' ] + + def configure(self, options, conf): + self.conf = conf + + def addSuccess(self, test): + self.html.append('ok') + + def addError(self, test, err): + err = self.formatErr(err) + self.html.append('ERROR') + self.html.append('
%s
' % escape(err)) + + def addFailure(self, test, err): + err = self.formatErr(err) + self.html.append('FAIL') + self.html.append('
%s
' % escape(err)) + + def finalize(self, result): + self.html.append('
') + self.html.append("Ran %d test%s" % + (result.testsRun, result.testsRun != 1 and "s" +or "")) + self.html.append('
') + self.html.append('
') + if not result.wasSuccessful(): + self.html.extend(['FAILED (', + 'failures=%d ' % len(result.failures), + 'errors=%d' % len(result.errors)]) + for cls in result.errorClasses.keys(): + storage, label, isfail = result.errorClasses[cls] + if isfail: + self.html.append(' %ss=%d' % (label, len(storage))) + self.html.append(')') + else: + self.html.append('OK') + self.html.append('
') + f = open('tmp/test-output.html', 'w') + for l in self.html: + f.write(l) + f.close() + + def formatErr(self, err): + exctype, value, tb = err + return ''.join(traceback.format_exception(exctype, value, tb)) + + def startContext(self, ctx): + try: + n = ctx.__name__ + except AttributeError: + n = str(ctx).replace('<', '').replace('>', '') + self.html.extend(['
', '', n, '']) + try: + path = ctx.__file__.replace('.pyc', '.py') + self.html.extend(['
', path, '
']) + except AttributeError: + pass + + def stopContext(self, ctx): + self.html.append('
') + + def startTest(self, test): + self.html.extend([ '
', + test.shortDescription() or str(test), + '' ]) + + def stopTest(self, test): + self.html.append('
') + diff --git a/tests/safe_mode/test.cfg b/tests/safe_mode/test.cfg new file mode 100644 index 0000000..d23e418 --- /dev/null +++ b/tests/safe_mode/test.cfg @@ -0,0 +1,2 @@ +[DEFAULT] +safe_mode=escape diff --git a/tests/test_apis.py b/tests/test_apis.py new file mode 100755 index 0000000..59b5a2e --- /dev/null +++ b/tests/test_apis.py @@ -0,0 +1,234 @@ +#!/usr/bin/python +""" +Python-Markdown Regression Tests +================================ + +Tests of the various APIs with the python markdown lib. + +""" + +import unittest +from doctest import DocTestSuite +import os +import markdown + +class TestMarkdownBasics(unittest.TestCase): + """ Tests basics of the Markdown class. """ + + def setUp(self): + """ Create instance of Markdown. """ + self.md = markdown.Markdown() + + def testBlankInput(self): + """ Test blank input. """ + self.assertEqual(self.md.convert(''), '') + + def testWhitespaceOnly(self): + """ Test input of only whitespace. """ + self.assertEqual(self.md.convert(' '), '') + + def testSimpleInput(self): + """ Test simple input. """ + self.assertEqual(self.md.convert('foo'), '

foo

') + +class TestBlockParser(unittest.TestCase): + """ Tests of the BlockParser class. """ + + def setUp(self): + """ Create instance of BlockParser. """ + self.parser = markdown.Markdown().parser + + def testParseChunk(self): + """ Test BlockParser.parseChunk. """ + root = markdown.etree.Element("div") + text = 'foo' + self.parser.parseChunk(root, text) + self.assertEqual(markdown.etree.tostring(root), "

foo

") + + def testParseDocument(self): + """ Test BlockParser.parseDocument. """ + lines = ['#foo', '', 'bar', '', ' baz'] + tree = self.parser.parseDocument(lines) + self.assert_(isinstance(tree, markdown.etree.ElementTree)) + self.assert_(markdown.etree.iselement(tree.getroot())) + self.assertEqual(markdown.etree.tostring(tree.getroot()), + "

foo

bar

baz\n
") + + +class TestBlockParserState(unittest.TestCase): + """ Tests of the State class for BlockParser. """ + + def setUp(self): + self.state = markdown.blockparser.State() + + def testBlankState(self): + """ Test State when empty. """ + self.assertEqual(self.state, []) + + def testSetSate(self): + """ Test State.set(). """ + self.state.set('a_state') + self.assertEqual(self.state, ['a_state']) + self.state.set('state2') + self.assertEqual(self.state, ['a_state', 'state2']) + + def testIsSate(self): + """ Test State.isstate(). """ + self.assertEqual(self.state.isstate('anything'), False) + self.state.set('a_state') + self.assertEqual(self.state.isstate('a_state'), True) + self.state.set('state2') + self.assertEqual(self.state.isstate('state2'), True) + self.assertEqual(self.state.isstate('a_state'), False) + self.assertEqual(self.state.isstate('missing'), False) + + def testReset(self): + """ Test State.reset(). """ + self.state.set('a_state') + self.state.reset() + self.assertEqual(self.state, []) + self.state.set('state1') + self.state.set('state2') + self.state.reset() + self.assertEqual(self.state, ['state1']) + +class TestHtmlStash(unittest.TestCase): + """ Test Markdown's HtmlStash. """ + + def setUp(self): + self.stash = markdown.preprocessors.HtmlStash() + self.placeholder = self.stash.store('foo') + + def testSimpleStore(self): + """ Test HtmlStash.store. """ + self.assertEqual(self.placeholder, + markdown.preprocessors.HTML_PLACEHOLDER % 0) + self.assertEqual(self.stash.html_counter, 1) + self.assertEqual(self.stash.rawHtmlBlocks, [('foo', False)]) + + def testStoreMore(self): + """ Test HtmlStash.store with additional blocks. """ + placeholder = self.stash.store('bar') + self.assertEqual(placeholder, + markdown.preprocessors.HTML_PLACEHOLDER % 1) + self.assertEqual(self.stash.html_counter, 2) + self.assertEqual(self.stash.rawHtmlBlocks, + [('foo', False), ('bar', False)]) + + def testSafeStore(self): + """ Test HtmlStash.store with 'safe' html. """ + self.stash.store('bar', True) + self.assertEqual(self.stash.rawHtmlBlocks, + [('foo', False), ('bar', True)]) + + def testReset(self): + """ Test HtmlStash.reset. """ + self.stash.reset() + self.assertEqual(self.stash.html_counter, 0) + self.assertEqual(self.stash.rawHtmlBlocks, []) + +class TestOrderedDict(unittest.TestCase): + """ Test OrderedDict storage class. """ + + def setUp(self): + self.odict = markdown.odict.OrderedDict() + self.odict['first'] = 'This' + self.odict['third'] = 'a' + self.odict['fourth'] = 'self' + self.odict['fifth'] = 'test' + + def testValues(self): + """ Test output of OrderedDict.values(). """ + self.assertEqual(self.odict.values(), ['This', 'a', 'self', 'test']) + + def testKeys(self): + """ Test output of OrderedDict.keys(). """ + self.assertEqual(self.odict.keys(), + ['first', 'third', 'fourth', 'fifth']) + + def testItems(self): + """ Test output of OrderedDict.items(). """ + self.assertEqual(self.odict.items(), + [('first', 'This'), ('third', 'a'), + ('fourth', 'self'), ('fifth', 'test')]) + + def testAddBefore(self): + """ Test adding an OrderedDict item before a given key. """ + self.odict.add('second', 'is', 'first') + self.assertEqual(self.odict.items(), + [('first', 'This'), ('second', 'is'), ('third', 'a'), + ('fourth', 'self'), ('fifth', 'test')]) + + def testAddAfterEnd(self): + """ Test adding an OrderedDict item after the last key. """ + self.odict.add('sixth', '.', '>fifth') + self.assertEqual(self.odict.items(), + [('first', 'This'), ('third', 'a'), + ('fourth', 'self'), ('fifth', 'test'), ('sixth', '.')]) + + def testAdd_begin(self): + """ Test adding an OrderedDict item using "_begin". """ + self.odict.add('zero', 'CRAZY', '_begin') + self.assertEqual(self.odict.items(), + [('zero', 'CRAZY'), ('first', 'This'), ('third', 'a'), + ('fourth', 'self'), ('fifth', 'test')]) + + def testAdd_end(self): + """ Test adding an OrderedDict item using "_end". """ + self.odict.add('sixth', '.', '_end') + self.assertEqual(self.odict.items(), + [('first', 'This'), ('third', 'a'), + ('fourth', 'self'), ('fifth', 'test'), ('sixth', '.')]) + + def testAddBadLocation(self): + """ Test Error on bad location in OrderedDict.add(). """ + self.assertRaises(ValueError, self.odict.add, 'sixth', '.', ' Date: Sat, 30 May 2009 22:31:55 -0400 Subject: Moves tests to a subdir of the markdown lib. --- tests/__init__.py | 44 - tests/base.py | 62 -- tests/extensions-x-abbr/abbr.html | 4 - tests/extensions-x-abbr/abbr.txt | 13 - tests/extensions-x-abbr/test.cfg | 2 - tests/extensions-x-codehilite/code.html | 16 - tests/extensions-x-codehilite/code.txt | 12 - tests/extensions-x-codehilite/test.cfg | 2 - tests/extensions-x-def_list/loose_def_list.html | 21 - tests/extensions-x-def_list/loose_def_list.txt | 20 - tests/extensions-x-def_list/markdown-syntax.html | 728 ----------------- tests/extensions-x-def_list/markdown-syntax.txt | 888 --------------------- tests/extensions-x-def_list/simple_def-lists.html | 37 - tests/extensions-x-def_list/simple_def-lists.txt | 29 - tests/extensions-x-def_list/test.cfg | 2 - tests/extensions-x-footnotes/footnote.html | 29 - tests/extensions-x-footnotes/footnote.txt | 14 - tests/extensions-x-footnotes/named_markers.html | 24 - tests/extensions-x-footnotes/named_markers.txt | 9 - tests/extensions-x-footnotes/test.cfg | 2 - tests/extensions-x-tables/tables.html | 119 --- tests/extensions-x-tables/tables.txt | 34 - tests/extensions-x-tables/test.cfg | 2 - tests/extensions-x-toc/invalid.html | 6 - tests/extensions-x-toc/invalid.txt | 9 - tests/extensions-x-toc/syntax-toc.html | 699 ---------------- tests/extensions-x-toc/syntax-toc.txt | 851 -------------------- tests/extensions-x-toc/test.cfg | 2 - tests/extensions-x-wikilinks/test.cfg | 2 - tests/extensions-x-wikilinks/wikilinks.html | 9 - tests/extensions-x-wikilinks/wikilinks.txt | 14 - tests/html4/html4.html | 2 - tests/html4/html4.txt | 2 - tests/html4/test.cfg | 2 - tests/markdown-test/amps-and-angle-encoding.html | 9 - tests/markdown-test/amps-and-angle-encoding.txt | 21 - tests/markdown-test/angle-links-and-img.html | 4 - tests/markdown-test/angle-links-and-img.txt | 4 - tests/markdown-test/auto-links.html | 15 - tests/markdown-test/auto-links.txt | 17 - tests/markdown-test/backlash-escapes.html | 67 -- tests/markdown-test/backlash-escapes.txt | 104 --- tests/markdown-test/benchmark.dat | 20 - .../blockquotes-with-code-blocks.html | 12 - .../markdown-test/blockquotes-with-code-blocks.txt | 11 - tests/markdown-test/codeblock-in-list.html | 14 - tests/markdown-test/codeblock-in-list.txt | 10 - tests/markdown-test/hard-wrapped.html | 7 - tests/markdown-test/hard-wrapped.txt | 8 - tests/markdown-test/horizontal-rules.html | 39 - tests/markdown-test/horizontal-rules.txt | 67 -- tests/markdown-test/inline-html-advanced.html | 12 - tests/markdown-test/inline-html-advanced.txt | 14 - tests/markdown-test/inline-html-comments.html | 11 - tests/markdown-test/inline-html-comments.txt | 13 - tests/markdown-test/inline-html-simple.html | 58 -- tests/markdown-test/inline-html-simple.txt | 69 -- tests/markdown-test/links-inline.html | 5 - tests/markdown-test/links-inline.txt | 9 - tests/markdown-test/links-reference.html | 10 - tests/markdown-test/links-reference.txt | 31 - tests/markdown-test/literal-quotes.html | 2 - tests/markdown-test/literal-quotes.txt | 7 - .../markdown-documentation-basics.html | 243 ------ .../markdown-documentation-basics.txt | 306 ------- tests/markdown-test/markdown-syntax.html | 728 ----------------- tests/markdown-test/markdown-syntax.txt | 888 --------------------- tests/markdown-test/nested-blockquotes.html | 7 - tests/markdown-test/nested-blockquotes.txt | 5 - .../markdown-test/ordered-and-unordered-list.html | 146 ---- tests/markdown-test/ordered-and-unordered-list.txt | 122 --- tests/markdown-test/strong-and-em-together.html | 4 - tests/markdown-test/strong-and-em-together.txt | 7 - tests/markdown-test/tabs.html | 23 - tests/markdown-test/tabs.txt | 21 - tests/markdown-test/tidyness.html | 8 - tests/markdown-test/tidyness.txt | 5 - tests/misc/CRLF_line_ends.html | 4 - tests/misc/CRLF_line_ends.txt | 5 - tests/misc/adjacent-headers.html | 2 - tests/misc/adjacent-headers.txt | 2 - tests/misc/amp-in-url.html | 1 - tests/misc/amp-in-url.txt | 1 - tests/misc/ampersand.html | 2 - tests/misc/ampersand.txt | 5 - tests/misc/arabic.html | 27 - tests/misc/arabic.txt | 37 - tests/misc/attributes2.html | 6 - tests/misc/attributes2.txt | 10 - tests/misc/autolinks_with_asterisks.html | 1 - tests/misc/autolinks_with_asterisks.txt | 2 - tests/misc/autolinks_with_asterisks_russian.html | 1 - tests/misc/autolinks_with_asterisks_russian.txt | 3 - tests/misc/backtick-escape.html | 3 - tests/misc/backtick-escape.txt | 3 - tests/misc/benchmark.dat | 56 -- tests/misc/bidi.html | 39 - tests/misc/bidi.txt | 68 -- tests/misc/blank-block-quote.html | 3 - tests/misc/blank-block-quote.txt | 6 - tests/misc/blockquote-below-paragraph.html | 15 - tests/misc/blockquote-below-paragraph.txt | 11 - tests/misc/blockquote-hr.html | 16 - tests/misc/blockquote-hr.txt | 21 - tests/misc/blockquote.html | 24 - tests/misc/blockquote.txt | 21 - tests/misc/bold_links.html | 1 - tests/misc/bold_links.txt | 1 - tests/misc/br.html | 11 - tests/misc/br.txt | 16 - tests/misc/bracket_re.html | 60 -- tests/misc/bracket_re.txt | 61 -- tests/misc/code-first-line.html | 2 - tests/misc/code-first-line.txt | 1 - tests/misc/comments.html | 5 - tests/misc/comments.txt | 7 - tests/misc/div.html | 4 - tests/misc/div.txt | 5 - tests/misc/em-around-links.html | 13 - tests/misc/em-around-links.txt | 14 - tests/misc/em_strong.html | 10 - tests/misc/em_strong.txt | 20 - tests/misc/email.html | 2 - tests/misc/email.txt | 3 - tests/misc/funky-list.html | 11 - tests/misc/funky-list.txt | 9 - tests/misc/h1.html | 3 - tests/misc/h1.txt | 7 - tests/misc/hash.html | 11 - tests/misc/hash.txt | 13 - tests/misc/headers.html | 10 - tests/misc/headers.txt | 15 - tests/misc/hline.html | 2 - tests/misc/hline.txt | 5 - tests/misc/html-comments.html | 2 - tests/misc/html-comments.txt | 2 - tests/misc/html.html | 9 - tests/misc/html.txt | 13 - tests/misc/image-2.html | 2 - tests/misc/image-2.txt | 3 - tests/misc/image.html | 1 - tests/misc/image.txt | 2 - tests/misc/image_in_links.html | 1 - tests/misc/image_in_links.txt | 3 - tests/misc/inside_html.html | 1 - tests/misc/inside_html.txt | 1 - tests/misc/japanese.html | 11 - tests/misc/japanese.txt | 15 - tests/misc/lazy-block-quote.html | 6 - tests/misc/lazy-block-quote.txt | 5 - tests/misc/link-with-parenthesis.html | 1 - tests/misc/link-with-parenthesis.txt | 1 - tests/misc/lists.html | 36 - tests/misc/lists.txt | 31 - tests/misc/lists2.html | 5 - tests/misc/lists2.txt | 3 - tests/misc/lists3.html | 5 - tests/misc/lists3.txt | 3 - tests/misc/lists4.html | 8 - tests/misc/lists4.txt | 5 - tests/misc/lists5.html | 14 - tests/misc/lists5.txt | 12 - tests/misc/markup-inside-p.html | 21 - tests/misc/markup-inside-p.txt | 21 - tests/misc/mismatched-tags.html | 11 - tests/misc/mismatched-tags.txt | 9 - tests/misc/missing-link-def.html | 1 - tests/misc/missing-link-def.txt | 4 - tests/misc/more_comments.html | 7 - tests/misc/more_comments.txt | 9 - tests/misc/multi-line-tags.html | 4 - tests/misc/multi-line-tags.txt | 6 - tests/misc/multi-paragraph-block-quote.html | 6 - tests/misc/multi-paragraph-block-quote.txt | 8 - tests/misc/multi-test.html | 20 - tests/misc/multi-test.txt | 32 - tests/misc/multiline-comments.html | 16 - tests/misc/multiline-comments.txt | 18 - tests/misc/nested-lists.html | 39 - tests/misc/nested-lists.txt | 24 - tests/misc/nested-patterns.html | 7 - tests/misc/nested-patterns.txt | 7 - tests/misc/normalize.html | 1 - tests/misc/normalize.txt | 2 - tests/misc/numeric-entity.html | 2 - tests/misc/numeric-entity.txt | 4 - tests/misc/para-with-hr.html | 3 - tests/misc/para-with-hr.txt | 4 - tests/misc/php.html | 11 - tests/misc/php.txt | 13 - tests/misc/pre.html | 13 - tests/misc/pre.txt | 14 - tests/misc/russian.html | 6 - tests/misc/russian.txt | 15 - tests/misc/some-test.html | 66 -- tests/misc/some-test.txt | 57 -- tests/misc/span.html | 6 - tests/misc/span.txt | 10 - tests/misc/strong-with-underscores.html | 1 - tests/misc/strong-with-underscores.txt | 1 - tests/misc/stronintags.html | 4 - tests/misc/stronintags.txt | 8 - tests/misc/tabs-in-lists.html | 42 - tests/misc/tabs-in-lists.txt | 32 - tests/misc/two-spaces.html | 21 - tests/misc/two-spaces.txt | 17 - tests/misc/uche.html | 3 - tests/misc/uche.txt | 7 - tests/misc/underscores.html | 6 - tests/misc/underscores.txt | 11 - tests/misc/url_spaces.html | 2 - tests/misc/url_spaces.txt | 4 - tests/plugins.py | 113 --- tests/safe_mode/inline-html-advanced.html | 11 - tests/safe_mode/inline-html-advanced.txt | 14 - tests/safe_mode/inline-html-comments.html | 8 - tests/safe_mode/inline-html-comments.txt | 13 - tests/safe_mode/inline-html-simple.html | 45 -- tests/safe_mode/inline-html-simple.txt | 69 -- tests/safe_mode/script_tags.html | 28 - tests/safe_mode/script_tags.txt | 33 - tests/safe_mode/test.cfg | 2 - tests/safe_mode/unsafe_urls.html | 20 - tests/safe_mode/unsafe_urls.txt | 27 - tests/test_apis.py | 234 ------ tests/util.py | 15 - 226 files changed, 9100 deletions(-) delete mode 100644 tests/__init__.py delete mode 100644 tests/base.py delete mode 100644 tests/extensions-x-abbr/abbr.html delete mode 100644 tests/extensions-x-abbr/abbr.txt delete mode 100644 tests/extensions-x-abbr/test.cfg delete mode 100644 tests/extensions-x-codehilite/code.html delete mode 100644 tests/extensions-x-codehilite/code.txt delete mode 100644 tests/extensions-x-codehilite/test.cfg delete mode 100644 tests/extensions-x-def_list/loose_def_list.html delete mode 100644 tests/extensions-x-def_list/loose_def_list.txt delete mode 100644 tests/extensions-x-def_list/markdown-syntax.html delete mode 100644 tests/extensions-x-def_list/markdown-syntax.txt delete mode 100644 tests/extensions-x-def_list/simple_def-lists.html delete mode 100644 tests/extensions-x-def_list/simple_def-lists.txt delete mode 100644 tests/extensions-x-def_list/test.cfg delete mode 100644 tests/extensions-x-footnotes/footnote.html delete mode 100644 tests/extensions-x-footnotes/footnote.txt delete mode 100644 tests/extensions-x-footnotes/named_markers.html delete mode 100644 tests/extensions-x-footnotes/named_markers.txt delete mode 100644 tests/extensions-x-footnotes/test.cfg delete mode 100644 tests/extensions-x-tables/tables.html delete mode 100644 tests/extensions-x-tables/tables.txt delete mode 100644 tests/extensions-x-tables/test.cfg delete mode 100644 tests/extensions-x-toc/invalid.html delete mode 100644 tests/extensions-x-toc/invalid.txt delete mode 100644 tests/extensions-x-toc/syntax-toc.html delete mode 100644 tests/extensions-x-toc/syntax-toc.txt delete mode 100644 tests/extensions-x-toc/test.cfg delete mode 100644 tests/extensions-x-wikilinks/test.cfg delete mode 100644 tests/extensions-x-wikilinks/wikilinks.html delete mode 100644 tests/extensions-x-wikilinks/wikilinks.txt delete mode 100644 tests/html4/html4.html delete mode 100644 tests/html4/html4.txt delete mode 100644 tests/html4/test.cfg delete mode 100644 tests/markdown-test/amps-and-angle-encoding.html delete mode 100644 tests/markdown-test/amps-and-angle-encoding.txt delete mode 100644 tests/markdown-test/angle-links-and-img.html delete mode 100644 tests/markdown-test/angle-links-and-img.txt delete mode 100644 tests/markdown-test/auto-links.html delete mode 100644 tests/markdown-test/auto-links.txt delete mode 100644 tests/markdown-test/backlash-escapes.html delete mode 100644 tests/markdown-test/backlash-escapes.txt delete mode 100644 tests/markdown-test/benchmark.dat delete mode 100644 tests/markdown-test/blockquotes-with-code-blocks.html delete mode 100644 tests/markdown-test/blockquotes-with-code-blocks.txt delete mode 100644 tests/markdown-test/codeblock-in-list.html delete mode 100644 tests/markdown-test/codeblock-in-list.txt delete mode 100644 tests/markdown-test/hard-wrapped.html delete mode 100644 tests/markdown-test/hard-wrapped.txt delete mode 100644 tests/markdown-test/horizontal-rules.html delete mode 100644 tests/markdown-test/horizontal-rules.txt delete mode 100644 tests/markdown-test/inline-html-advanced.html delete mode 100644 tests/markdown-test/inline-html-advanced.txt delete mode 100644 tests/markdown-test/inline-html-comments.html delete mode 100644 tests/markdown-test/inline-html-comments.txt delete mode 100644 tests/markdown-test/inline-html-simple.html delete mode 100644 tests/markdown-test/inline-html-simple.txt delete mode 100644 tests/markdown-test/links-inline.html delete mode 100644 tests/markdown-test/links-inline.txt delete mode 100644 tests/markdown-test/links-reference.html delete mode 100644 tests/markdown-test/links-reference.txt delete mode 100644 tests/markdown-test/literal-quotes.html delete mode 100644 tests/markdown-test/literal-quotes.txt delete mode 100644 tests/markdown-test/markdown-documentation-basics.html delete mode 100644 tests/markdown-test/markdown-documentation-basics.txt delete mode 100644 tests/markdown-test/markdown-syntax.html delete mode 100644 tests/markdown-test/markdown-syntax.txt delete mode 100644 tests/markdown-test/nested-blockquotes.html delete mode 100644 tests/markdown-test/nested-blockquotes.txt delete mode 100644 tests/markdown-test/ordered-and-unordered-list.html delete mode 100644 tests/markdown-test/ordered-and-unordered-list.txt delete mode 100644 tests/markdown-test/strong-and-em-together.html delete mode 100644 tests/markdown-test/strong-and-em-together.txt delete mode 100644 tests/markdown-test/tabs.html delete mode 100644 tests/markdown-test/tabs.txt delete mode 100644 tests/markdown-test/tidyness.html delete mode 100644 tests/markdown-test/tidyness.txt delete mode 100644 tests/misc/CRLF_line_ends.html delete mode 100644 tests/misc/CRLF_line_ends.txt delete mode 100644 tests/misc/adjacent-headers.html delete mode 100644 tests/misc/adjacent-headers.txt delete mode 100644 tests/misc/amp-in-url.html delete mode 100644 tests/misc/amp-in-url.txt delete mode 100644 tests/misc/ampersand.html delete mode 100644 tests/misc/ampersand.txt delete mode 100644 tests/misc/arabic.html delete mode 100644 tests/misc/arabic.txt delete mode 100644 tests/misc/attributes2.html delete mode 100644 tests/misc/attributes2.txt delete mode 100644 tests/misc/autolinks_with_asterisks.html delete mode 100644 tests/misc/autolinks_with_asterisks.txt delete mode 100644 tests/misc/autolinks_with_asterisks_russian.html delete mode 100644 tests/misc/autolinks_with_asterisks_russian.txt delete mode 100644 tests/misc/backtick-escape.html delete mode 100644 tests/misc/backtick-escape.txt delete mode 100644 tests/misc/benchmark.dat delete mode 100644 tests/misc/bidi.html delete mode 100644 tests/misc/bidi.txt delete mode 100644 tests/misc/blank-block-quote.html delete mode 100644 tests/misc/blank-block-quote.txt delete mode 100644 tests/misc/blockquote-below-paragraph.html delete mode 100644 tests/misc/blockquote-below-paragraph.txt delete mode 100644 tests/misc/blockquote-hr.html delete mode 100644 tests/misc/blockquote-hr.txt delete mode 100644 tests/misc/blockquote.html delete mode 100644 tests/misc/blockquote.txt delete mode 100644 tests/misc/bold_links.html delete mode 100644 tests/misc/bold_links.txt delete mode 100644 tests/misc/br.html delete mode 100644 tests/misc/br.txt delete mode 100644 tests/misc/bracket_re.html delete mode 100644 tests/misc/bracket_re.txt delete mode 100644 tests/misc/code-first-line.html delete mode 100644 tests/misc/code-first-line.txt delete mode 100644 tests/misc/comments.html delete mode 100644 tests/misc/comments.txt delete mode 100644 tests/misc/div.html delete mode 100644 tests/misc/div.txt delete mode 100644 tests/misc/em-around-links.html delete mode 100644 tests/misc/em-around-links.txt delete mode 100644 tests/misc/em_strong.html delete mode 100644 tests/misc/em_strong.txt delete mode 100644 tests/misc/email.html delete mode 100644 tests/misc/email.txt delete mode 100644 tests/misc/funky-list.html delete mode 100644 tests/misc/funky-list.txt delete mode 100644 tests/misc/h1.html delete mode 100644 tests/misc/h1.txt delete mode 100644 tests/misc/hash.html delete mode 100644 tests/misc/hash.txt delete mode 100644 tests/misc/headers.html delete mode 100644 tests/misc/headers.txt delete mode 100644 tests/misc/hline.html delete mode 100644 tests/misc/hline.txt delete mode 100644 tests/misc/html-comments.html delete mode 100644 tests/misc/html-comments.txt delete mode 100644 tests/misc/html.html delete mode 100644 tests/misc/html.txt delete mode 100644 tests/misc/image-2.html delete mode 100644 tests/misc/image-2.txt delete mode 100644 tests/misc/image.html delete mode 100644 tests/misc/image.txt delete mode 100644 tests/misc/image_in_links.html delete mode 100644 tests/misc/image_in_links.txt delete mode 100644 tests/misc/inside_html.html delete mode 100644 tests/misc/inside_html.txt delete mode 100644 tests/misc/japanese.html delete mode 100644 tests/misc/japanese.txt delete mode 100644 tests/misc/lazy-block-quote.html delete mode 100644 tests/misc/lazy-block-quote.txt delete mode 100644 tests/misc/link-with-parenthesis.html delete mode 100644 tests/misc/link-with-parenthesis.txt delete mode 100644 tests/misc/lists.html delete mode 100644 tests/misc/lists.txt delete mode 100644 tests/misc/lists2.html delete mode 100644 tests/misc/lists2.txt delete mode 100644 tests/misc/lists3.html delete mode 100644 tests/misc/lists3.txt delete mode 100644 tests/misc/lists4.html delete mode 100644 tests/misc/lists4.txt delete mode 100644 tests/misc/lists5.html delete mode 100644 tests/misc/lists5.txt delete mode 100644 tests/misc/markup-inside-p.html delete mode 100644 tests/misc/markup-inside-p.txt delete mode 100644 tests/misc/mismatched-tags.html delete mode 100644 tests/misc/mismatched-tags.txt delete mode 100644 tests/misc/missing-link-def.html delete mode 100644 tests/misc/missing-link-def.txt delete mode 100644 tests/misc/more_comments.html delete mode 100644 tests/misc/more_comments.txt delete mode 100644 tests/misc/multi-line-tags.html delete mode 100644 tests/misc/multi-line-tags.txt delete mode 100644 tests/misc/multi-paragraph-block-quote.html delete mode 100644 tests/misc/multi-paragraph-block-quote.txt delete mode 100644 tests/misc/multi-test.html delete mode 100644 tests/misc/multi-test.txt delete mode 100644 tests/misc/multiline-comments.html delete mode 100644 tests/misc/multiline-comments.txt delete mode 100644 tests/misc/nested-lists.html delete mode 100644 tests/misc/nested-lists.txt delete mode 100644 tests/misc/nested-patterns.html delete mode 100644 tests/misc/nested-patterns.txt delete mode 100644 tests/misc/normalize.html delete mode 100644 tests/misc/normalize.txt delete mode 100644 tests/misc/numeric-entity.html delete mode 100644 tests/misc/numeric-entity.txt delete mode 100644 tests/misc/para-with-hr.html delete mode 100644 tests/misc/para-with-hr.txt delete mode 100644 tests/misc/php.html delete mode 100644 tests/misc/php.txt delete mode 100644 tests/misc/pre.html delete mode 100644 tests/misc/pre.txt delete mode 100644 tests/misc/russian.html delete mode 100644 tests/misc/russian.txt delete mode 100644 tests/misc/some-test.html delete mode 100644 tests/misc/some-test.txt delete mode 100644 tests/misc/span.html delete mode 100644 tests/misc/span.txt delete mode 100644 tests/misc/strong-with-underscores.html delete mode 100644 tests/misc/strong-with-underscores.txt delete mode 100644 tests/misc/stronintags.html delete mode 100644 tests/misc/stronintags.txt delete mode 100644 tests/misc/tabs-in-lists.html delete mode 100644 tests/misc/tabs-in-lists.txt delete mode 100644 tests/misc/two-spaces.html delete mode 100644 tests/misc/two-spaces.txt delete mode 100644 tests/misc/uche.html delete mode 100644 tests/misc/uche.txt delete mode 100644 tests/misc/underscores.html delete mode 100644 tests/misc/underscores.txt delete mode 100644 tests/misc/url_spaces.html delete mode 100644 tests/misc/url_spaces.txt delete mode 100644 tests/plugins.py delete mode 100644 tests/safe_mode/inline-html-advanced.html delete mode 100644 tests/safe_mode/inline-html-advanced.txt delete mode 100644 tests/safe_mode/inline-html-comments.html delete mode 100644 tests/safe_mode/inline-html-comments.txt delete mode 100644 tests/safe_mode/inline-html-simple.html delete mode 100644 tests/safe_mode/inline-html-simple.txt delete mode 100644 tests/safe_mode/script_tags.html delete mode 100644 tests/safe_mode/script_tags.txt delete mode 100644 tests/safe_mode/test.cfg delete mode 100644 tests/safe_mode/unsafe_urls.html delete mode 100644 tests/safe_mode/unsafe_urls.txt delete mode 100755 tests/test_apis.py delete mode 100644 tests/util.py (limited to 'tests') diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index 63ddf5b..0000000 --- a/tests/__init__.py +++ /dev/null @@ -1,44 +0,0 @@ -import os -import markdown -import codecs -import difflib -import nose -import util -from plugins import MdSyntaxError, HtmlOutput, MdSyntaxErrorPlugin -from test_apis import * - -test_dir = os.path.abspath(os.path.dirname(__file__)) - -def normalize(text): - return ['%s\n' % l for l in text.strip().split('\n')] - -def check_syntax(file, config): - input_file = file + ".txt" - input = codecs.open(input_file, encoding="utf-8").read() - output_file = file + ".html" - expected_output = codecs.open(output_file, encoding="utf-8").read() - output = normalize(markdown.markdown(input, - config.get('DEFAULT', 'extensions'), - config.get('DEFAULT', 'safe_mode'), - config.get('DEFAULT', 'output_format'))) - diff = [l for l in difflib.unified_diff(normalize(expected_output), - output, output_file, - 'actual_output.html', n=3)] - if diff: - raise util.MdSyntaxError('Output from "%s" failed to match expected ' - 'output.\n\n%s' % (input_file, ''.join(diff))) - -def test_markdown_syntax(): - for dir_name, sub_dirs, files in os.walk(test_dir): - # Get dir specific config settings. - config = util.CustomConfigParser({'extensions': '', - 'safe_mode': False, - 'output_format': 'xhtml1'}) - config.read(os.path.join(dir_name, 'test.cfg')) - # Loop through files and generate tests. - for file in files: - root, ext = os.path.splitext(file) - if ext == '.txt': - yield check_syntax, os.path.join(dir_name, root), config - -nose.main(addplugins=[HtmlOutput(), MdSyntaxErrorPlugin()]) diff --git a/tests/base.py b/tests/base.py deleted file mode 100644 index 9e70996..0000000 --- a/tests/base.py +++ /dev/null @@ -1,62 +0,0 @@ -import os, codecs -import markdown -from nose.tools import assert_equal -import difflib -from plugins import MdSyntaxError - -class SyntaxBase: - """ - Generator that steps through all files in a dir and runs each text file - (*.txt) as a seperate unit test. - - Each subclass of SyntaxBase should define `dir` as a string containing the - name of the directory which holds the test files. For example: - - dir = "path/to/mytests" - - A subclass may redefine the `setUp` method to create a custom `Markdown` - instance specific to that batch of tests. - - """ - - dir = "" - - def __init__(self): - self.files = [x.replace(".txt", "") - for x in os.listdir(self.dir) if x.endswith(".txt")] - - def setUp(self): - """ - Create Markdown instance. - - Override this method to create a custom `Markdown` instance assigned to - `self.md`. For example: - - self.md = markdown.Markdown(extensions=["footnotes"], safe_mode="replace") - - """ - self.md = markdown.Markdown() - - def tearDown(self): - """ tearDown is not implemented. """ - pass - - def test_syntax(self): - for file in self.files: - yield self.check_syntax, file - - def check_syntax(self, file): - input_file = os.path.join(self.dir, file + ".txt") - input = codecs.open(input_file, encoding="utf-8").read() - output_file = os.path.join(self.dir, file + ".html") - expected_output = codecs.open(output_file, encoding="utf-8").read() - output = self.normalize(self.md.convert(input)) - diff = [l for l in difflib.unified_diff(self.normalize(expected_output), - output, output_file, - 'actual_output.html', n=3)] - if diff: - #assert False, - raise MdSyntaxError('Output from "%s" failed to match expected output.\n\n%s' % (input_file, ''.join(diff))) - - def normalize(self, text): - return ['%s\n' % l for l in text.strip().split('\n')] diff --git a/tests/extensions-x-abbr/abbr.html b/tests/extensions-x-abbr/abbr.html deleted file mode 100644 index 456524e..0000000 --- a/tests/extensions-x-abbr/abbr.html +++ /dev/null @@ -1,4 +0,0 @@ -

An ABBR: "REF". -ref and REFERENCE should be ignored.

-

The HTML specification -is maintained by the W3C.

\ No newline at end of file diff --git a/tests/extensions-x-abbr/abbr.txt b/tests/extensions-x-abbr/abbr.txt deleted file mode 100644 index 991bf15..0000000 --- a/tests/extensions-x-abbr/abbr.txt +++ /dev/null @@ -1,13 +0,0 @@ -An ABBR: "REF". -ref and REFERENCE should be ignored. - -*[REF]: Reference -*[ABBR]: This gets overriden by the next one. -*[ABBR]: Abbreviation - -The HTML specification -is maintained by the W3C. - -*[HTML]: Hyper Text Markup Language -*[W3C]: World Wide Web Consortium - diff --git a/tests/extensions-x-abbr/test.cfg b/tests/extensions-x-abbr/test.cfg deleted file mode 100644 index 32d437f..0000000 --- a/tests/extensions-x-abbr/test.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[DEFAULT] -extensions=abbr diff --git a/tests/extensions-x-codehilite/code.html b/tests/extensions-x-codehilite/code.html deleted file mode 100644 index 6a8ee91..0000000 --- a/tests/extensions-x-codehilite/code.html +++ /dev/null @@ -1,16 +0,0 @@ -

Some text

-
1
-2
-3
-4
-5
-6
def __init__ (self, pattern) :
-    self.pattern = pattern
-    self.compiled_re = re.compile("^(.*)%s(.*)$" % pattern, re.DOTALL)
-
-def getCompiledRegExp (self) :
-    return self.compiled_re
-
-
- -

More text

\ No newline at end of file diff --git a/tests/extensions-x-codehilite/code.txt b/tests/extensions-x-codehilite/code.txt deleted file mode 100644 index 6c62e6a..0000000 --- a/tests/extensions-x-codehilite/code.txt +++ /dev/null @@ -1,12 +0,0 @@ - -Some text - - #!python - def __init__ (self, pattern) : - self.pattern = pattern - self.compiled_re = re.compile("^(.*)%s(.*)$" % pattern, re.DOTALL) - - def getCompiledRegExp (self) : - return self.compiled_re - -More text \ No newline at end of file diff --git a/tests/extensions-x-codehilite/test.cfg b/tests/extensions-x-codehilite/test.cfg deleted file mode 100644 index 6ed10a2..0000000 --- a/tests/extensions-x-codehilite/test.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[DEFAULT] -extensions=codehilite diff --git a/tests/extensions-x-def_list/loose_def_list.html b/tests/extensions-x-def_list/loose_def_list.html deleted file mode 100644 index 98fdec8..0000000 --- a/tests/extensions-x-def_list/loose_def_list.html +++ /dev/null @@ -1,21 +0,0 @@ -

some text

-
-
term 1
-
-

def 1-1

-
-
-

def 2-2

-
-
term 2
-
term 3
-
-

def 2-1 -line 2 of def 2-1

-
-
-

def 2-2

-

par 2 of def2-2

-
-
-

more text

\ No newline at end of file diff --git a/tests/extensions-x-def_list/loose_def_list.txt b/tests/extensions-x-def_list/loose_def_list.txt deleted file mode 100644 index 24cd6a4..0000000 --- a/tests/extensions-x-def_list/loose_def_list.txt +++ /dev/null @@ -1,20 +0,0 @@ -some text - -term 1 - -: def 1-1 - -: def 2-2 - -term 2 -term 3 - -: def 2-1 - line 2 of def 2-1 - -: def 2-2 - - par 2 of def2-2 - -more text - diff --git a/tests/extensions-x-def_list/markdown-syntax.html b/tests/extensions-x-def_list/markdown-syntax.html deleted file mode 100644 index 038c9d1..0000000 --- a/tests/extensions-x-def_list/markdown-syntax.html +++ /dev/null @@ -1,728 +0,0 @@ -

Markdown: Syntax

- - - -

Note: This document is itself written using Markdown; you -can see the source for it by adding '.text' to the URL.

-
-

Overview

- -

Philosophy

- -

Markdown is intended to be as easy-to-read and easy-to-write as is feasible.

-

Readability, however, is emphasized above all else. A Markdown-formatted -document should be publishable as-is, as plain text, without looking -like it's been marked up with tags or formatting instructions. While -Markdown's syntax has been influenced by several existing text-to-HTML -filters -- including Setext, atx, Textile, reStructuredText, -Grutatext, and EtText -- the single biggest source of -inspiration for Markdown's syntax is the format of plain text email.

-

To this end, Markdown's syntax is comprised entirely of punctuation -characters, which punctuation characters have been carefully chosen so -as to look like what they mean. E.g., asterisks around a word actually -look like *emphasis*. Markdown lists look like, well, lists. Even -blockquotes look like quoted passages of text, assuming you've ever -used email.

-

Inline HTML

- -

Markdown's syntax is intended for one purpose: to be used as a -format for writing for the web.

-

Markdown is not a replacement for HTML, or even close to it. Its -syntax is very small, corresponding only to a very small subset of -HTML tags. The idea is not to create a syntax that makes it easier -to insert HTML tags. In my opinion, HTML tags are already easy to -insert. The idea for Markdown is to make it easy to read, write, and -edit prose. HTML is a publishing format; Markdown is a writing -format. Thus, Markdown's formatting syntax only addresses issues that -can be conveyed in plain text.

-

For any markup that is not covered by Markdown's syntax, you simply -use HTML itself. There's no need to preface it or delimit it to -indicate that you're switching from Markdown to HTML; you just use -the tags.

-

The only restrictions are that block-level HTML elements -- e.g. <div>, -<table>, <pre>, <p>, etc. -- must be separated from surrounding -content by blank lines, and the start and end tags of the block should -not be indented with tabs or spaces. Markdown is smart enough not -to add extra (unwanted) <p> tags around HTML block-level tags.

-

For example, to add an HTML table to a Markdown article:

-
This is a regular paragraph.
-
-<table>
-    <tr>
-        <td>Foo</td>
-    </tr>
-</table>
-
-This is another regular paragraph.
-
-

Note that Markdown formatting syntax is not processed within block-level -HTML tags. E.g., you can't use Markdown-style *emphasis* inside an -HTML block.

-

Span-level HTML tags -- e.g. <span>, <cite>, or <del> -- can be -used anywhere in a Markdown paragraph, list item, or header. If you -want, you can even use HTML tags instead of Markdown formatting; e.g. if -you'd prefer to use HTML <a> or <img> tags instead of Markdown's -link or image syntax, go right ahead.

-

Unlike block-level HTML tags, Markdown syntax is processed within -span-level tags.

-

Automatic Escaping for Special Characters

- -

In HTML, there are two characters that demand special treatment: < -and &. Left angle brackets are used to start tags; ampersands are -used to denote HTML entities. If you want to use them as literal -characters, you must escape them as entities, e.g. &lt;, and -&amp;.

-

Ampersands in particular are bedeviling for web writers. If you want to -write about 'AT&T', you need to write 'AT&amp;T'. You even need to -escape ampersands within URLs. Thus, if you want to link to:

-
http://images.google.com/images?num=30&q=larry+bird
-
-

you need to encode the URL as:

-
http://images.google.com/images?num=30&amp;q=larry+bird
-
-

in your anchor tag href attribute. Needless to say, this is easy to -forget, and is probably the single most common source of HTML validation -errors in otherwise well-marked-up web sites.

-

Markdown allows you to use these characters naturally, taking care of -all the necessary escaping for you. If you use an ampersand as part of -an HTML entity, it remains unchanged; otherwise it will be translated -into &amp;.

-

So, if you want to include a copyright symbol in your article, you can write:

-
&copy;
-
-

and Markdown will leave it alone. But if you write:

-
AT&T
-
-

Markdown will translate it to:

-
AT&amp;T
-
-

Similarly, because Markdown supports inline HTML, if you use -angle brackets as delimiters for HTML tags, Markdown will treat them as -such. But if you write:

-
4 < 5
-
-

Markdown will translate it to:

-
4 &lt; 5
-
-

However, inside Markdown code spans and blocks, angle brackets and -ampersands are always encoded automatically. This makes it easy to use -Markdown to write about HTML code. (As opposed to raw HTML, which is a -terrible format for writing about HTML syntax, because every single < -and & in your example code needs to be escaped.)

-
-

Block Elements

- -

Paragraphs and Line Breaks

- -

A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing but spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs.

-

The implication of the "one or more consecutive lines of text" rule is -that Markdown supports "hard-wrapped" text paragraphs. This differs -significantly from most other text-to-HTML formatters (including Movable -Type's "Convert Line Breaks" option) which translate every line break -character in a paragraph into a <br /> tag.

-

When you do want to insert a <br /> break tag using Markdown, you -end a line with two or more spaces, then type return.

-

Yes, this takes a tad more effort to create a <br />, but a simplistic -"every line break is a <br />" rule wouldn't work for Markdown. -Markdown's email-style blockquoting and multi-paragraph list items -work best -- and look better -- when you format them with hard breaks.

- - -

Markdown supports two styles of headers, Setext and atx.

-

Setext-style headers are "underlined" using equal signs (for first-level -headers) and dashes (for second-level headers). For example:

-
This is an H1
-=============
-
-This is an H2
--------------
-
-

Any number of underlining ='s or -'s will work.

-

Atx-style headers use 1-6 hash characters at the start of the line, -corresponding to header levels 1-6. For example:

-
# This is an H1
-
-## This is an H2
-
-###### This is an H6
-
-

Optionally, you may "close" atx-style headers. This is purely -cosmetic -- you can use this if you think it looks better. The -closing hashes don't even need to match the number of hashes -used to open the header. (The number of opening hashes -determines the header level.) :

-
# This is an H1 #
-
-## This is an H2 ##
-
-### This is an H3 ######
-
-

Blockquotes

- -

Markdown uses email-style > characters for blockquoting. If you're -familiar with quoting passages of text in an email message, then you -know how to create a blockquote in Markdown. It looks best if you hard -wrap the text and put a > before every line:

-
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
-> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
-> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
-> 
-> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
-> id sem consectetuer libero luctus adipiscing.
-
-

Markdown allows you to be lazy and only put the > before the first -line of a hard-wrapped paragraph:

-
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
-consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
-Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
-
-> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
-id sem consectetuer libero luctus adipiscing.
-
-

Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by -adding additional levels of >:

-
> This is the first level of quoting.
->
-> > This is nested blockquote.
->
-> Back to the first level.
-
-

Blockquotes can contain other Markdown elements, including headers, lists, -and code blocks:

-
> ## This is a header.
-> 
-> 1.   This is the first list item.
-> 2.   This is the second list item.
-> 
-> Here's some example code:
-> 
->     return shell_exec("echo $input | $markdown_script");
-
-

Any decent text editor should make email-style quoting easy. For -example, with BBEdit, you can make a selection and choose Increase -Quote Level from the Text menu.

-

Lists

- -

Markdown supports ordered (numbered) and unordered (bulleted) lists.

-

Unordered lists use asterisks, pluses, and hyphens -- interchangably --- as list markers:

-
*   Red
-*   Green
-*   Blue
-
-

is equivalent to:

-
+   Red
-+   Green
-+   Blue
-
-

and:

-
-   Red
--   Green
--   Blue
-
-

Ordered lists use numbers followed by periods:

-
1.  Bird
-2.  McHale
-3.  Parish
-
-

It's important to note that the actual numbers you use to mark the -list have no effect on the HTML output Markdown produces. The HTML -Markdown produces from the above list is:

-
<ol>
-<li>Bird</li>
-<li>McHale</li>
-<li>Parish</li>
-</ol>
-
-

If you instead wrote the list in Markdown like this:

-
1.  Bird
-1.  McHale
-1.  Parish
-
-

or even:

-
3. Bird
-1. McHale
-8. Parish
-
-

you'd get the exact same HTML output. The point is, if you want to, -you can use ordinal numbers in your ordered Markdown lists, so that -the numbers in your source match the numbers in your published HTML. -But if you want to be lazy, you don't have to.

-

If you do use lazy list numbering, however, you should still start the -list with the number 1. At some point in the future, Markdown may support -starting ordered lists at an arbitrary number.

-

List markers typically start at the left margin, but may be indented by -up to three spaces. List markers must be followed by one or more spaces -or a tab.

-

To make lists look nice, you can wrap items with hanging indents:

-
*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
-    Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
-    viverra nec, fringilla in, laoreet vitae, risus.
-*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
-    Suspendisse id sem consectetuer libero luctus adipiscing.
-
-

But if you want to be lazy, you don't have to:

-
*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
-Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
-viverra nec, fringilla in, laoreet vitae, risus.
-*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
-Suspendisse id sem consectetuer libero luctus adipiscing.
-
-

If list items are separated by blank lines, Markdown will wrap the -items in <p> tags in the HTML output. For example, this input:

-
*   Bird
-*   Magic
-
-

will turn into:

-
<ul>
-<li>Bird</li>
-<li>Magic</li>
-</ul>
-
-

But this:

-
*   Bird
-
-*   Magic
-
-

will turn into:

-
<ul>
-<li><p>Bird</p></li>
-<li><p>Magic</p></li>
-</ul>
-
-

List items may consist of multiple paragraphs. Each subsequent -paragraph in a list item must be intended by either 4 spaces -or one tab:

-
1.  This is a list item with two paragraphs. Lorem ipsum dolor
-    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
-    mi posuere lectus.
-
-    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
-    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
-    sit amet velit.
-
-2.  Suspendisse id sem consectetuer libero luctus adipiscing.
-
-

It looks nice if you indent every line of the subsequent -paragraphs, but here again, Markdown will allow you to be -lazy:

-
*   This is a list item with two paragraphs.
-
-    This is the second paragraph in the list item. You're
-only required to indent the first line. Lorem ipsum dolor
-sit amet, consectetuer adipiscing elit.
-
-*   Another item in the same list.
-
-

To put a blockquote within a list item, the blockquote's > -delimiters need to be indented:

-
*   A list item with a blockquote:
-
-    > This is a blockquote
-    > inside a list item.
-
-

To put a code block within a list item, the code block needs -to be indented twice -- 8 spaces or two tabs:

-
*   A list item with a code block:
-
-        <code goes here>
-
-

It's worth noting that it's possible to trigger an ordered list by -accident, by writing something like this:

-
1986. What a great season.
-
-

In other words, a number-period-space sequence at the beginning of a -line. To avoid this, you can backslash-escape the period:

-
1986\. What a great season.
-
-

Code Blocks

- -

Pre-formatted code blocks are used for writing about programming or -markup source code. Rather than forming normal paragraphs, the lines -of a code block are interpreted literally. Markdown wraps a code block -in both <pre> and <code> tags.

-

To produce a code block in Markdown, simply indent every line of the -block by at least 4 spaces or 1 tab. For example, given this input:

-
This is a normal paragraph:
-
-    This is a code block.
-
-

Markdown will generate:

-
<p>This is a normal paragraph:</p>
-
-<pre><code>This is a code block.
-</code></pre>
-
-

One level of indentation -- 4 spaces or 1 tab -- is removed from each -line of the code block. For example, this:

-
Here is an example of AppleScript:
-
-    tell application "Foo"
-        beep
-    end tell
-
-

will turn into:

-
<p>Here is an example of AppleScript:</p>
-
-<pre><code>tell application "Foo"
-    beep
-end tell
-</code></pre>
-
-

A code block continues until it reaches a line that is not indented -(or the end of the article).

-

Within a code block, ampersands (&) and angle brackets (< and >) -are automatically converted into HTML entities. This makes it very -easy to include example HTML source code using Markdown -- just paste -it and indent it, and Markdown will handle the hassle of encoding the -ampersands and angle brackets. For example, this:

-
    <div class="footer">
-        &copy; 2004 Foo Corporation
-    </div>
-
-

will turn into:

-
<pre><code>&lt;div class="footer"&gt;
-    &amp;copy; 2004 Foo Corporation
-&lt;/div&gt;
-</code></pre>
-
-

Regular Markdown syntax is not processed within code blocks. E.g., -asterisks are just literal asterisks within a code block. This means -it's also easy to use Markdown to write about Markdown's own syntax.

-

Horizontal Rules

- -

You can produce a horizontal rule tag (<hr />) by placing three or -more hyphens, asterisks, or underscores on a line by themselves. If you -wish, you may use spaces between the hyphens or asterisks. Each of the -following lines will produce a horizontal rule:

-
* * *
-
-***
-
-*****
-
-- - -
-
----------------------------------------
-
-_ _ _
-
-
-

Span Elements

- - - -

Markdown supports two style of links: inline and reference.

-

In both styles, the link text is delimited by [square brackets].

-

To create an inline link, use a set of regular parentheses immediately -after the link text's closing square bracket. Inside the parentheses, -put the URL where you want the link to point, along with an optional -title for the link, surrounded in quotes. For example:

-
This is [an example](http://example.com/ "Title") inline link.
-
-[This link](http://example.net/) has no title attribute.
-
-

Will produce:

-
<p>This is <a href="http://example.com/" title="Title">
-an example</a> inline link.</p>
-
-<p><a href="http://example.net/">This link</a> has no
-title attribute.</p>
-
-

If you're referring to a local resource on the same server, you can -use relative paths:

-
See my [About](/about/) page for details.
-
-

Reference-style links use a second set of square brackets, inside -which you place a label of your choosing to identify the link:

-
This is [an example][id] reference-style link.
-
-

You can optionally use a space to separate the sets of brackets:

-
This is [an example] [id] reference-style link.
-
-

Then, anywhere in the document, you define your link label like this, -on a line by itself:

-
[id]: http://example.com/  "Optional Title Here"
-
-

That is:

-
    -
  • Square brackets containing the link identifier (optionally - indented from the left margin using up to three spaces);
  • -
  • followed by a colon;
  • -
  • followed by one or more spaces (or tabs);
  • -
  • followed by the URL for the link;
  • -
  • optionally followed by a title attribute for the link, enclosed - in double or single quotes.
  • -
-

The link URL may, optionally, be surrounded by angle brackets:

-
[id]: <http://example.com/>  "Optional Title Here"
-
-

You can put the title attribute on the next line and use extra spaces -or tabs for padding, which tends to look better with longer URLs:

-
[id]: http://example.com/longish/path/to/resource/here
-    "Optional Title Here"
-
-

Link definitions are only used for creating links during Markdown -processing, and are stripped from your document in the HTML output.

-

Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are not case sensitive. E.g. these two links:

-
[link text][a]
-[link text][A]
-
-

are equivalent.

-

The implicit link name shortcut allows you to omit the name of the -link, in which case the link text itself is used as the name. -Just use an empty set of square brackets -- e.g., to link the word -"Google" to the google.com web site, you could simply write:

-
[Google][]
-
-

And then define the link:

-
[Google]: http://google.com/
-
-

Because link names may contain spaces, this shortcut even works for -multiple words in the link text:

-
Visit [Daring Fireball][] for more information.
-
-

And then define the link:

-
[Daring Fireball]: http://daringfireball.net/
-
-

Link definitions can be placed anywhere in your Markdown document. I -tend to put them immediately after each paragraph in which they're -used, but if you want, you can put them all at the end of your -document, sort of like footnotes.

-

Here's an example of reference links in action:

-
I get 10 times more traffic from [Google] [1] than from
-[Yahoo] [2] or [MSN] [3].
-
-  [1]: http://google.com/        "Google"
-  [2]: http://search.yahoo.com/  "Yahoo Search"
-  [3]: http://search.msn.com/    "MSN Search"
-
-

Using the implicit link name shortcut, you could instead write:

-
I get 10 times more traffic from [Google][] than from
-[Yahoo][] or [MSN][].
-
-  [google]: http://google.com/        "Google"
-  [yahoo]:  http://search.yahoo.com/  "Yahoo Search"
-  [msn]:    http://search.msn.com/    "MSN Search"
-
-

Both of the above examples will produce the following HTML output:

-
<p>I get 10 times more traffic from <a href="http://google.com/"
-title="Google">Google</a> than from
-<a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
-or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
-
-

For comparison, here is the same paragraph written using -Markdown's inline link style:

-
I get 10 times more traffic from [Google](http://google.com/ "Google")
-than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
-[MSN](http://search.msn.com/ "MSN Search").
-
-

The point of reference-style links is not that they're easier to -write. The point is that with reference-style links, your document -source is vastly more readable. Compare the above examples: using -reference-style links, the paragraph itself is only 81 characters -long; with inline-style links, it's 176 characters; and as raw HTML, -it's 234 characters. In the raw HTML, there's more markup than there -is text.

-

With Markdown's reference-style links, a source document much more -closely resembles the final output, as rendered in a browser. By -allowing you to move the markup-related metadata out of the paragraph, -you can add links without interrupting the narrative flow of your -prose.

-

Emphasis

- -

Markdown treats asterisks (*) and underscores (_) as indicators of -emphasis. Text wrapped with one * or _ will be wrapped with an -HTML <em> tag; double *'s or _'s will be wrapped with an HTML -<strong> tag. E.g., this input:

-
*single asterisks*
-
-_single underscores_
-
-**double asterisks**
-
-__double underscores__
-
-

will produce:

-
<em>single asterisks</em>
-
-<em>single underscores</em>
-
-<strong>double asterisks</strong>
-
-<strong>double underscores</strong>
-
-

You can use whichever style you prefer; the lone restriction is that -the same character must be used to open and close an emphasis span.

-

Emphasis can be used in the middle of a word:

-
un*fucking*believable
-
-

But if you surround an * or _ with spaces, it'll be treated as a -literal asterisk or underscore.

-

To produce a literal asterisk or underscore at a position where it -would otherwise be used as an emphasis delimiter, you can backslash -escape it:

-
\*this text is surrounded by literal asterisks\*
-
-

Code

- -

To indicate a span of code, wrap it with backtick quotes (`). -Unlike a pre-formatted code block, a code span indicates code within a -normal paragraph. For example:

-
Use the `printf()` function.
-
-

will produce:

-
<p>Use the <code>printf()</code> function.</p>
-
-

To include a literal backtick character within a code span, you can use -multiple backticks as the opening and closing delimiters:

-
``There is a literal backtick (`) here.``
-
-

which will produce this:

-
<p><code>There is a literal backtick (`) here.</code></p>
-
-

The backtick delimiters surrounding a code span may include spaces -- -one after the opening, one before the closing. This allows you to place -literal backtick characters at the beginning or end of a code span:

-
A single backtick in a code span: `` ` ``
-
-A backtick-delimited string in a code span: `` `foo` ``
-
-

will produce:

-
<p>A single backtick in a code span: <code>`</code></p>
-
-<p>A backtick-delimited string in a code span: <code>`foo`</code></p>
-
-

With a code span, ampersands and angle brackets are encoded as HTML -entities automatically, which makes it easy to include example HTML -tags. Markdown will turn this:

-
Please don't use any `<blink>` tags.
-
-

into:

-
<p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
-
-

You can write this:

-
`&#8212;` is the decimal-encoded equivalent of `&mdash;`.
-
-

to produce:

-
<p><code>&amp;#8212;</code> is the decimal-encoded
-equivalent of <code>&amp;mdash;</code>.</p>
-
-

Images

- -

Admittedly, it's fairly difficult to devise a "natural" syntax for -placing images into a plain text document format.

-

Markdown uses an image syntax that is intended to resemble the syntax -for links, allowing for two styles: inline and reference.

-

Inline image syntax looks like this:

-
![Alt text](/path/to/img.jpg)
-
-![Alt text](/path/to/img.jpg "Optional title")
-
-

That is:

-
    -
  • An exclamation mark: !;
  • -
  • followed by a set of square brackets, containing the alt - attribute text for the image;
  • -
  • followed by a set of parentheses, containing the URL or path to - the image, and an optional title attribute enclosed in double - or single quotes.
  • -
-

Reference-style image syntax looks like this:

-
![Alt text][id]
-
-

Where "id" is the name of a defined image reference. Image references -are defined using syntax identical to link references:

-
[id]: url/to/image  "Optional title attribute"
-
-

As of this writing, Markdown has no syntax for specifying the -dimensions of an image; if this is important to you, you can simply -use regular HTML <img> tags.

-
-

Miscellaneous

- - - -

Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:

-
<http://example.com/>
-
-

Markdown will turn this into:

-
<a href="http://example.com/">http://example.com/</a>
-
-

Automatic links for email addresses work similarly, except that -Markdown will also perform a bit of randomized decimal and hex -entity-encoding to help obscure your address from address-harvesting -spambots. For example, Markdown will turn this:

-
<address@example.com>
-
-

into something like this:

-
<a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65;
-&#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;
-&#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61;
-&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a>
-
-

which will render in a browser as a clickable link to "address@example.com".

-

(This sort of entity-encoding trick will indeed fool many, if not -most, address-harvesting bots, but it definitely won't fool all of -them. It's better than nothing, but an address published in this way -will probably eventually start receiving spam.)

-

Backslash Escapes

- -

Markdown allows you to use backslash escapes to generate literal -characters which would otherwise have special meaning in Markdown's -formatting syntax. For example, if you wanted to surround a word with -literal asterisks (instead of an HTML <em> tag), you can backslashes -before the asterisks, like this:

-
\*literal asterisks\*
-
-

Markdown provides backslash escapes for the following characters:

-
\   backslash
-`   backtick
-*   asterisk
-_   underscore
-{}  curly braces
-[]  square brackets
-()  parentheses
-#   hash mark
-+   plus sign
--   minus sign (hyphen)
-.   dot
-!   exclamation mark
-
\ No newline at end of file diff --git a/tests/extensions-x-def_list/markdown-syntax.txt b/tests/extensions-x-def_list/markdown-syntax.txt deleted file mode 100644 index dabd75c..0000000 --- a/tests/extensions-x-def_list/markdown-syntax.txt +++ /dev/null @@ -1,888 +0,0 @@ -Markdown: Syntax -================ - - - - -* [Overview](#overview) - * [Philosophy](#philosophy) - * [Inline HTML](#html) - * [Automatic Escaping for Special Characters](#autoescape) -* [Block Elements](#block) - * [Paragraphs and Line Breaks](#p) - * [Headers](#header) - * [Blockquotes](#blockquote) - * [Lists](#list) - * [Code Blocks](#precode) - * [Horizontal Rules](#hr) -* [Span Elements](#span) - * [Links](#link) - * [Emphasis](#em) - * [Code](#code) - * [Images](#img) -* [Miscellaneous](#misc) - * [Backslash Escapes](#backslash) - * [Automatic Links](#autolink) - - -**Note:** This document is itself written using Markdown; you -can [see the source for it by adding '.text' to the URL][src]. - - [src]: /projects/markdown/syntax.text - -* * * - -

Overview

- -

Philosophy

- -Markdown is intended to be as easy-to-read and easy-to-write as is feasible. - -Readability, however, is emphasized above all else. A Markdown-formatted -document should be publishable as-is, as plain text, without looking -like it's been marked up with tags or formatting instructions. While -Markdown's syntax has been influenced by several existing text-to-HTML -filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4], -[Grutatext] [5], and [EtText] [6] -- the single biggest source of -inspiration for Markdown's syntax is the format of plain text email. - - [1]: http://docutils.sourceforge.net/mirror/setext.html - [2]: http://www.aaronsw.com/2002/atx/ - [3]: http://textism.com/tools/textile/ - [4]: http://docutils.sourceforge.net/rst.html - [5]: http://www.triptico.com/software/grutatxt.html - [6]: http://ettext.taint.org/doc/ - -To this end, Markdown's syntax is comprised entirely of punctuation -characters, which punctuation characters have been carefully chosen so -as to look like what they mean. E.g., asterisks around a word actually -look like \*emphasis\*. Markdown lists look like, well, lists. Even -blockquotes look like quoted passages of text, assuming you've ever -used email. - - - -

Inline HTML

- -Markdown's syntax is intended for one purpose: to be used as a -format for *writing* for the web. - -Markdown is not a replacement for HTML, or even close to it. Its -syntax is very small, corresponding only to a very small subset of -HTML tags. The idea is *not* to create a syntax that makes it easier -to insert HTML tags. In my opinion, HTML tags are already easy to -insert. The idea for Markdown is to make it easy to read, write, and -edit prose. HTML is a *publishing* format; Markdown is a *writing* -format. Thus, Markdown's formatting syntax only addresses issues that -can be conveyed in plain text. - -For any markup that is not covered by Markdown's syntax, you simply -use HTML itself. There's no need to preface it or delimit it to -indicate that you're switching from Markdown to HTML; you just use -the tags. - -The only restrictions are that block-level HTML elements -- e.g. `
`, -``, `
`, `

`, etc. -- must be separated from surrounding -content by blank lines, and the start and end tags of the block should -not be indented with tabs or spaces. Markdown is smart enough not -to add extra (unwanted) `

` tags around HTML block-level tags. - -For example, to add an HTML table to a Markdown article: - - This is a regular paragraph. - -

- - - -
Foo
- - This is another regular paragraph. - -Note that Markdown formatting syntax is not processed within block-level -HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an -HTML block. - -Span-level HTML tags -- e.g. ``, ``, or `` -- can be -used anywhere in a Markdown paragraph, list item, or header. If you -want, you can even use HTML tags instead of Markdown formatting; e.g. if -you'd prefer to use HTML `` or `` tags instead of Markdown's -link or image syntax, go right ahead. - -Unlike block-level HTML tags, Markdown syntax *is* processed within -span-level tags. - - -

Automatic Escaping for Special Characters

- -In HTML, there are two characters that demand special treatment: `<` -and `&`. Left angle brackets are used to start tags; ampersands are -used to denote HTML entities. If you want to use them as literal -characters, you must escape them as entities, e.g. `<`, and -`&`. - -Ampersands in particular are bedeviling for web writers. If you want to -write about 'AT&T', you need to write '`AT&T`'. You even need to -escape ampersands within URLs. Thus, if you want to link to: - - http://images.google.com/images?num=30&q=larry+bird - -you need to encode the URL as: - - http://images.google.com/images?num=30&q=larry+bird - -in your anchor tag `href` attribute. Needless to say, this is easy to -forget, and is probably the single most common source of HTML validation -errors in otherwise well-marked-up web sites. - -Markdown allows you to use these characters naturally, taking care of -all the necessary escaping for you. If you use an ampersand as part of -an HTML entity, it remains unchanged; otherwise it will be translated -into `&`. - -So, if you want to include a copyright symbol in your article, you can write: - - © - -and Markdown will leave it alone. But if you write: - - AT&T - -Markdown will translate it to: - - AT&T - -Similarly, because Markdown supports [inline HTML](#html), if you use -angle brackets as delimiters for HTML tags, Markdown will treat them as -such. But if you write: - - 4 < 5 - -Markdown will translate it to: - - 4 < 5 - -However, inside Markdown code spans and blocks, angle brackets and -ampersands are *always* encoded automatically. This makes it easy to use -Markdown to write about HTML code. (As opposed to raw HTML, which is a -terrible format for writing about HTML syntax, because every single `<` -and `&` in your example code needs to be escaped.) - - -* * * - - -

Block Elements

- - -

Paragraphs and Line Breaks

- -A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing but spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs. - -The implication of the "one or more consecutive lines of text" rule is -that Markdown supports "hard-wrapped" text paragraphs. This differs -significantly from most other text-to-HTML formatters (including Movable -Type's "Convert Line Breaks" option) which translate every line break -character in a paragraph into a `
` tag. - -When you *do* want to insert a `
` break tag using Markdown, you -end a line with two or more spaces, then type return. - -Yes, this takes a tad more effort to create a `
`, but a simplistic -"every line break is a `
`" rule wouldn't work for Markdown. -Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l] -work best -- and look better -- when you format them with hard breaks. - - [bq]: #blockquote - [l]: #list - - - - - -Markdown supports two styles of headers, [Setext] [1] and [atx] [2]. - -Setext-style headers are "underlined" using equal signs (for first-level -headers) and dashes (for second-level headers). For example: - - This is an H1 - ============= - - This is an H2 - ------------- - -Any number of underlining `=`'s or `-`'s will work. - -Atx-style headers use 1-6 hash characters at the start of the line, -corresponding to header levels 1-6. For example: - - # This is an H1 - - ## This is an H2 - - ###### This is an H6 - -Optionally, you may "close" atx-style headers. This is purely -cosmetic -- you can use this if you think it looks better. The -closing hashes don't even need to match the number of hashes -used to open the header. (The number of opening hashes -determines the header level.) : - - # This is an H1 # - - ## This is an H2 ## - - ### This is an H3 ###### - - -

Blockquotes

- -Markdown uses email-style `>` characters for blockquoting. If you're -familiar with quoting passages of text in an email message, then you -know how to create a blockquote in Markdown. It looks best if you hard -wrap the text and put a `>` before every line: - - > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, - > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. - > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. - > - > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse - > id sem consectetuer libero luctus adipiscing. - -Markdown allows you to be lazy and only put the `>` before the first -line of a hard-wrapped paragraph: - - > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, - consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. - Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. - - > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse - id sem consectetuer libero luctus adipiscing. - -Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by -adding additional levels of `>`: - - > This is the first level of quoting. - > - > > This is nested blockquote. - > - > Back to the first level. - -Blockquotes can contain other Markdown elements, including headers, lists, -and code blocks: - - > ## This is a header. - > - > 1. This is the first list item. - > 2. This is the second list item. - > - > Here's some example code: - > - > return shell_exec("echo $input | $markdown_script"); - -Any decent text editor should make email-style quoting easy. For -example, with BBEdit, you can make a selection and choose Increase -Quote Level from the Text menu. - - -

Lists

- -Markdown supports ordered (numbered) and unordered (bulleted) lists. - -Unordered lists use asterisks, pluses, and hyphens -- interchangably --- as list markers: - - * Red - * Green - * Blue - -is equivalent to: - - + Red - + Green - + Blue - -and: - - - Red - - Green - - Blue - -Ordered lists use numbers followed by periods: - - 1. Bird - 2. McHale - 3. Parish - -It's important to note that the actual numbers you use to mark the -list have no effect on the HTML output Markdown produces. The HTML -Markdown produces from the above list is: - -
    -
  1. Bird
  2. -
  3. McHale
  4. -
  5. Parish
  6. -
- -If you instead wrote the list in Markdown like this: - - 1. Bird - 1. McHale - 1. Parish - -or even: - - 3. Bird - 1. McHale - 8. Parish - -you'd get the exact same HTML output. The point is, if you want to, -you can use ordinal numbers in your ordered Markdown lists, so that -the numbers in your source match the numbers in your published HTML. -But if you want to be lazy, you don't have to. - -If you do use lazy list numbering, however, you should still start the -list with the number 1. At some point in the future, Markdown may support -starting ordered lists at an arbitrary number. - -List markers typically start at the left margin, but may be indented by -up to three spaces. List markers must be followed by one or more spaces -or a tab. - -To make lists look nice, you can wrap items with hanging indents: - - * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. - Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, - viverra nec, fringilla in, laoreet vitae, risus. - * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. - Suspendisse id sem consectetuer libero luctus adipiscing. - -But if you want to be lazy, you don't have to: - - * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. - Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, - viverra nec, fringilla in, laoreet vitae, risus. - * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. - Suspendisse id sem consectetuer libero luctus adipiscing. - -If list items are separated by blank lines, Markdown will wrap the -items in `

` tags in the HTML output. For example, this input: - - * Bird - * Magic - -will turn into: - -

    -
  • Bird
  • -
  • Magic
  • -
- -But this: - - * Bird - - * Magic - -will turn into: - -
    -
  • Bird

  • -
  • Magic

  • -
- -List items may consist of multiple paragraphs. Each subsequent -paragraph in a list item must be intended by either 4 spaces -or one tab: - - 1. This is a list item with two paragraphs. Lorem ipsum dolor - sit amet, consectetuer adipiscing elit. Aliquam hendrerit - mi posuere lectus. - - Vestibulum enim wisi, viverra nec, fringilla in, laoreet - vitae, risus. Donec sit amet nisl. Aliquam semper ipsum - sit amet velit. - - 2. Suspendisse id sem consectetuer libero luctus adipiscing. - -It looks nice if you indent every line of the subsequent -paragraphs, but here again, Markdown will allow you to be -lazy: - - * This is a list item with two paragraphs. - - This is the second paragraph in the list item. You're - only required to indent the first line. Lorem ipsum dolor - sit amet, consectetuer adipiscing elit. - - * Another item in the same list. - -To put a blockquote within a list item, the blockquote's `>` -delimiters need to be indented: - - * A list item with a blockquote: - - > This is a blockquote - > inside a list item. - -To put a code block within a list item, the code block needs -to be indented *twice* -- 8 spaces or two tabs: - - * A list item with a code block: - - - - -It's worth noting that it's possible to trigger an ordered list by -accident, by writing something like this: - - 1986. What a great season. - -In other words, a *number-period-space* sequence at the beginning of a -line. To avoid this, you can backslash-escape the period: - - 1986\. What a great season. - - - -

Code Blocks

- -Pre-formatted code blocks are used for writing about programming or -markup source code. Rather than forming normal paragraphs, the lines -of a code block are interpreted literally. Markdown wraps a code block -in both `
` and `` tags.
-
-To produce a code block in Markdown, simply indent every line of the
-block by at least 4 spaces or 1 tab. For example, given this input:
-
-    This is a normal paragraph:
-
-        This is a code block.
-
-Markdown will generate:
-
-    

This is a normal paragraph:

- -
This is a code block.
-    
- -One level of indentation -- 4 spaces or 1 tab -- is removed from each -line of the code block. For example, this: - - Here is an example of AppleScript: - - tell application "Foo" - beep - end tell - -will turn into: - -

Here is an example of AppleScript:

- -
tell application "Foo"
-        beep
-    end tell
-    
- -A code block continues until it reaches a line that is not indented -(or the end of the article). - -Within a code block, ampersands (`&`) and angle brackets (`<` and `>`) -are automatically converted into HTML entities. This makes it very -easy to include example HTML source code using Markdown -- just paste -it and indent it, and Markdown will handle the hassle of encoding the -ampersands and angle brackets. For example, this: - - - -will turn into: - -
<div class="footer">
-        &copy; 2004 Foo Corporation
-    </div>
-    
- -Regular Markdown syntax is not processed within code blocks. E.g., -asterisks are just literal asterisks within a code block. This means -it's also easy to use Markdown to write about Markdown's own syntax. - - - -

Horizontal Rules

- -You can produce a horizontal rule tag (`
`) by placing three or -more hyphens, asterisks, or underscores on a line by themselves. If you -wish, you may use spaces between the hyphens or asterisks. Each of the -following lines will produce a horizontal rule: - - * * * - - *** - - ***** - - - - - - - --------------------------------------- - - _ _ _ - - -* * * - -

Span Elements

- - - -Markdown supports two style of links: *inline* and *reference*. - -In both styles, the link text is delimited by [square brackets]. - -To create an inline link, use a set of regular parentheses immediately -after the link text's closing square bracket. Inside the parentheses, -put the URL where you want the link to point, along with an *optional* -title for the link, surrounded in quotes. For example: - - This is [an example](http://example.com/ "Title") inline link. - - [This link](http://example.net/) has no title attribute. - -Will produce: - -

This is - an example inline link.

- -

This link has no - title attribute.

- -If you're referring to a local resource on the same server, you can -use relative paths: - - See my [About](/about/) page for details. - -Reference-style links use a second set of square brackets, inside -which you place a label of your choosing to identify the link: - - This is [an example][id] reference-style link. - -You can optionally use a space to separate the sets of brackets: - - This is [an example] [id] reference-style link. - -Then, anywhere in the document, you define your link label like this, -on a line by itself: - - [id]: http://example.com/ "Optional Title Here" - -That is: - -* Square brackets containing the link identifier (optionally - indented from the left margin using up to three spaces); -* followed by a colon; -* followed by one or more spaces (or tabs); -* followed by the URL for the link; -* optionally followed by a title attribute for the link, enclosed - in double or single quotes. - -The link URL may, optionally, be surrounded by angle brackets: - - [id]: "Optional Title Here" - -You can put the title attribute on the next line and use extra spaces -or tabs for padding, which tends to look better with longer URLs: - - [id]: http://example.com/longish/path/to/resource/here - "Optional Title Here" - -Link definitions are only used for creating links during Markdown -processing, and are stripped from your document in the HTML output. - -Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are *not* case sensitive. E.g. these two links: - - [link text][a] - [link text][A] - -are equivalent. - -The *implicit link name* shortcut allows you to omit the name of the -link, in which case the link text itself is used as the name. -Just use an empty set of square brackets -- e.g., to link the word -"Google" to the google.com web site, you could simply write: - - [Google][] - -And then define the link: - - [Google]: http://google.com/ - -Because link names may contain spaces, this shortcut even works for -multiple words in the link text: - - Visit [Daring Fireball][] for more information. - -And then define the link: - - [Daring Fireball]: http://daringfireball.net/ - -Link definitions can be placed anywhere in your Markdown document. I -tend to put them immediately after each paragraph in which they're -used, but if you want, you can put them all at the end of your -document, sort of like footnotes. - -Here's an example of reference links in action: - - I get 10 times more traffic from [Google] [1] than from - [Yahoo] [2] or [MSN] [3]. - - [1]: http://google.com/ "Google" - [2]: http://search.yahoo.com/ "Yahoo Search" - [3]: http://search.msn.com/ "MSN Search" - -Using the implicit link name shortcut, you could instead write: - - I get 10 times more traffic from [Google][] than from - [Yahoo][] or [MSN][]. - - [google]: http://google.com/ "Google" - [yahoo]: http://search.yahoo.com/ "Yahoo Search" - [msn]: http://search.msn.com/ "MSN Search" - -Both of the above examples will produce the following HTML output: - -

I get 10 times more traffic from Google than from - Yahoo - or MSN.

- -For comparison, here is the same paragraph written using -Markdown's inline link style: - - I get 10 times more traffic from [Google](http://google.com/ "Google") - than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or - [MSN](http://search.msn.com/ "MSN Search"). - -The point of reference-style links is not that they're easier to -write. The point is that with reference-style links, your document -source is vastly more readable. Compare the above examples: using -reference-style links, the paragraph itself is only 81 characters -long; with inline-style links, it's 176 characters; and as raw HTML, -it's 234 characters. In the raw HTML, there's more markup than there -is text. - -With Markdown's reference-style links, a source document much more -closely resembles the final output, as rendered in a browser. By -allowing you to move the markup-related metadata out of the paragraph, -you can add links without interrupting the narrative flow of your -prose. - - -

Emphasis

- -Markdown treats asterisks (`*`) and underscores (`_`) as indicators of -emphasis. Text wrapped with one `*` or `_` will be wrapped with an -HTML `` tag; double `*`'s or `_`'s will be wrapped with an HTML -`` tag. E.g., this input: - - *single asterisks* - - _single underscores_ - - **double asterisks** - - __double underscores__ - -will produce: - - single asterisks - - single underscores - - double asterisks - - double underscores - -You can use whichever style you prefer; the lone restriction is that -the same character must be used to open and close an emphasis span. - -Emphasis can be used in the middle of a word: - - un*fucking*believable - -But if you surround an `*` or `_` with spaces, it'll be treated as a -literal asterisk or underscore. - -To produce a literal asterisk or underscore at a position where it -would otherwise be used as an emphasis delimiter, you can backslash -escape it: - - \*this text is surrounded by literal asterisks\* - - - -

Code

- -To indicate a span of code, wrap it with backtick quotes (`` ` ``). -Unlike a pre-formatted code block, a code span indicates code within a -normal paragraph. For example: - - Use the `printf()` function. - -will produce: - -

Use the printf() function.

- -To include a literal backtick character within a code span, you can use -multiple backticks as the opening and closing delimiters: - - ``There is a literal backtick (`) here.`` - -which will produce this: - -

There is a literal backtick (`) here.

- -The backtick delimiters surrounding a code span may include spaces -- -one after the opening, one before the closing. This allows you to place -literal backtick characters at the beginning or end of a code span: - - A single backtick in a code span: `` ` `` - - A backtick-delimited string in a code span: `` `foo` `` - -will produce: - -

A single backtick in a code span: `

- -

A backtick-delimited string in a code span: `foo`

- -With a code span, ampersands and angle brackets are encoded as HTML -entities automatically, which makes it easy to include example HTML -tags. Markdown will turn this: - - Please don't use any `` tags. - -into: - -

Please don't use any <blink> tags.

- -You can write this: - - `—` is the decimal-encoded equivalent of `—`. - -to produce: - -

&#8212; is the decimal-encoded - equivalent of &mdash;.

- - - -

Images

- -Admittedly, it's fairly difficult to devise a "natural" syntax for -placing images into a plain text document format. - -Markdown uses an image syntax that is intended to resemble the syntax -for links, allowing for two styles: *inline* and *reference*. - -Inline image syntax looks like this: - - ![Alt text](/path/to/img.jpg) - - ![Alt text](/path/to/img.jpg "Optional title") - -That is: - -* An exclamation mark: `!`; -* followed by a set of square brackets, containing the `alt` - attribute text for the image; -* followed by a set of parentheses, containing the URL or path to - the image, and an optional `title` attribute enclosed in double - or single quotes. - -Reference-style image syntax looks like this: - - ![Alt text][id] - -Where "id" is the name of a defined image reference. Image references -are defined using syntax identical to link references: - - [id]: url/to/image "Optional title attribute" - -As of this writing, Markdown has no syntax for specifying the -dimensions of an image; if this is important to you, you can simply -use regular HTML `` tags. - - -* * * - - -

Miscellaneous

- - - -Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this: - - - -Markdown will turn this into: - - http://example.com/ - -Automatic links for email addresses work similarly, except that -Markdown will also perform a bit of randomized decimal and hex -entity-encoding to help obscure your address from address-harvesting -spambots. For example, Markdown will turn this: - - - -into something like this: - - address@exa - mple.com - -which will render in a browser as a clickable link to "address@example.com". - -(This sort of entity-encoding trick will indeed fool many, if not -most, address-harvesting bots, but it definitely won't fool all of -them. It's better than nothing, but an address published in this way -will probably eventually start receiving spam.) - - - -

Backslash Escapes

- -Markdown allows you to use backslash escapes to generate literal -characters which would otherwise have special meaning in Markdown's -formatting syntax. For example, if you wanted to surround a word with -literal asterisks (instead of an HTML `` tag), you can backslashes -before the asterisks, like this: - - \*literal asterisks\* - -Markdown provides backslash escapes for the following characters: - - \ backslash - ` backtick - * asterisk - _ underscore - {} curly braces - [] square brackets - () parentheses - # hash mark - + plus sign - - minus sign (hyphen) - . dot - ! exclamation mark - diff --git a/tests/extensions-x-def_list/simple_def-lists.html b/tests/extensions-x-def_list/simple_def-lists.html deleted file mode 100644 index 278e1ec..0000000 --- a/tests/extensions-x-def_list/simple_def-lists.html +++ /dev/null @@ -1,37 +0,0 @@ -

Some text

-
-
term1
-
Def1
-
term2-1
-
term2-2
-
Def2-1
-
Def2-2
-
-

more text

-
-
term 3
-
-

def 3 -line 2 of def 3

-

paragraph 2 of def 3.

-
-
-

def 3-2

-
# A code block in a def
-
-
-

a blockquote

-
-
    -
  • -

    a list item

    -
  • -
  • -
    -

    blockquote in list

    -
    -
  • -
-
-
-

final text.

\ No newline at end of file diff --git a/tests/extensions-x-def_list/simple_def-lists.txt b/tests/extensions-x-def_list/simple_def-lists.txt deleted file mode 100644 index 20c028a..0000000 --- a/tests/extensions-x-def_list/simple_def-lists.txt +++ /dev/null @@ -1,29 +0,0 @@ -Some text - -term1 -: Def1 - -term2-1 -term2-2 -: Def2-1 -: Def2-2 - -more text - -term *3* -: def 3 - line __2__ of def 3 - - paragraph 2 of def 3. - -: def 3-2 - - # A code block in a def - - > a blockquote - - * a list item - - * > blockquote in list - -final text. diff --git a/tests/extensions-x-def_list/test.cfg b/tests/extensions-x-def_list/test.cfg deleted file mode 100644 index c9f352d..0000000 --- a/tests/extensions-x-def_list/test.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[DEFAULT] -extensions=def_list diff --git a/tests/extensions-x-footnotes/footnote.html b/tests/extensions-x-footnotes/footnote.html deleted file mode 100644 index 6556dab..0000000 --- a/tests/extensions-x-footnotes/footnote.html +++ /dev/null @@ -1,29 +0,0 @@ -

This is the body with a footnote1 or two2 or more3 4.

-
-
-
    -
  1. -

    Footnote that ends with a list:

    -
      -
    • item 1
    • -
    • item 2
    • -
    -

    -
  2. -
  3. -
    -

    This footnote is a blockquote. -

    -
    -

    -
  4. -
  5. -

    A simple oneliner. - 

    -
  6. -
  7. -

    A footnote with multiple paragraphs.

    -

    Paragraph two. 

    -
  8. -
-
\ No newline at end of file diff --git a/tests/extensions-x-footnotes/footnote.txt b/tests/extensions-x-footnotes/footnote.txt deleted file mode 100644 index 07188d0..0000000 --- a/tests/extensions-x-footnotes/footnote.txt +++ /dev/null @@ -1,14 +0,0 @@ -This is the body with a footnote[^1] or two[^2] or more[^3] [^4]. - -[^1]: Footnote that ends with a list: - - * item 1 - * item 2 - -[^2]: > This footnote is a blockquote. - -[^3]: A simple oneliner. - -[^4]: A footnote with multiple paragraphs. - - Paragraph two. diff --git a/tests/extensions-x-footnotes/named_markers.html b/tests/extensions-x-footnotes/named_markers.html deleted file mode 100644 index 6996b5f..0000000 --- a/tests/extensions-x-footnotes/named_markers.html +++ /dev/null @@ -1,24 +0,0 @@ -

This is the body with footnotes1 -that have named2 markers and -oddly3 numbered4 markers.

-
-
-
    -
  1. -

    Footnote marked foo. - 

    -
  2. -
  3. -

    This one is marked bar. - 

    -
  4. -
  5. -

    A numbered footnote. - 

    -
  6. -
  7. -

    The last one. - 

    -
  8. -
-
\ No newline at end of file diff --git a/tests/extensions-x-footnotes/named_markers.txt b/tests/extensions-x-footnotes/named_markers.txt deleted file mode 100644 index d246524..0000000 --- a/tests/extensions-x-footnotes/named_markers.txt +++ /dev/null @@ -1,9 +0,0 @@ -This is the body with footnotes[^foo] -that have named[^bar] markers and -oddly[^56] numbered[^99] markers. - -[^foo]: Footnote marked ``foo``. -[^bar]: This one is marked *bar*. -[^56]: A __numbered__ footnote. -[^99]: The last one. - diff --git a/tests/extensions-x-footnotes/test.cfg b/tests/extensions-x-footnotes/test.cfg deleted file mode 100644 index a5f0818..0000000 --- a/tests/extensions-x-footnotes/test.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[DEFAULT] -extensions=footnotes diff --git a/tests/extensions-x-tables/tables.html b/tests/extensions-x-tables/tables.html deleted file mode 100644 index c931e6a..0000000 --- a/tests/extensions-x-tables/tables.html +++ /dev/null @@ -1,119 +0,0 @@ -

Table Tests

- - - - - - - - - - - - - - - - - -
First HeaderSecond Header
Content CellContent Cell
Content CellContent Cell
- - - - - - - - - - - - - - - - - -
First HeaderSecond Header
Content CellContent Cell
Content CellContent Cell
- - - - - - - - - - - - - - - - - - - - - -
ItemValue
Computer$1600
Phone$12
Pipe$1
- - - - - - - - - - - - - - - - - -
Function nameDescription
help()Display the help window.
destroy()Destroy your computer!
- - - - - - - - - - - - - - - - - -
foobarbaz
-Q -
W -W
- - - - - - - - - - - - - - - - - -
foobarbaz
-Q -
W -W
\ No newline at end of file diff --git a/tests/extensions-x-tables/tables.txt b/tests/extensions-x-tables/tables.txt deleted file mode 100644 index 64917ab..0000000 --- a/tests/extensions-x-tables/tables.txt +++ /dev/null @@ -1,34 +0,0 @@ -Table Tests ------------ - -First Header | Second Header -------------- | ------------- -Content Cell | Content Cell -Content Cell | Content Cell - -| First Header | Second Header | -| ------------- | ------------- | -| Content Cell | Content Cell | -| Content Cell | Content Cell | - -| Item | Value | -| :-------- | -----:| -| Computer | $1600 | -| Phone | $12 | -| Pipe | $1 | - -| Function name | Description | -| ------------- | ------------------------------ | -| `help()` | Display the help window. | -| `destroy()` | **Destroy your computer!** | - -|foo|bar|baz| -|:--|:-:|--:| -| | Q | | -|W | | W| - -foo|bar|baz ----|---|--- - | Q | - W | | W - diff --git a/tests/extensions-x-tables/test.cfg b/tests/extensions-x-tables/test.cfg deleted file mode 100644 index ce5a83d..0000000 --- a/tests/extensions-x-tables/test.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[DEFAULT] -extensions=tables diff --git a/tests/extensions-x-toc/invalid.html b/tests/extensions-x-toc/invalid.html deleted file mode 100644 index 41a3b1f..0000000 --- a/tests/extensions-x-toc/invalid.html +++ /dev/null @@ -1,6 +0,0 @@ -

[TOC]

-

Header 1

-

The TOC marker cannot be inside a header. This test makes sure markdown doesn't -crash when it encounters this errant syntax. The unexpected output should -clue the author in that s/he needs to add a blank line between the TOC and -the <hr>.

\ No newline at end of file diff --git a/tests/extensions-x-toc/invalid.txt b/tests/extensions-x-toc/invalid.txt deleted file mode 100644 index f6c4ec4..0000000 --- a/tests/extensions-x-toc/invalid.txt +++ /dev/null @@ -1,9 +0,0 @@ -[TOC] ------ - -# Header 1 - -The TOC marker cannot be inside a header. This test makes sure markdown doesn't -crash when it encounters this errant syntax. The unexpected output should -clue the author in that s/he needs to add a blank line between the TOC and -the `
`. diff --git a/tests/extensions-x-toc/syntax-toc.html b/tests/extensions-x-toc/syntax-toc.html deleted file mode 100644 index 3559d45..0000000 --- a/tests/extensions-x-toc/syntax-toc.html +++ /dev/null @@ -1,699 +0,0 @@ - -

Overview

-

Philosophy

-

Markdown is intended to be as easy-to-read and easy-to-write as is feasible.

-

Readability, however, is emphasized above all else. A Markdown-formatted -document should be publishable as-is, as plain text, without looking -like it's been marked up with tags or formatting instructions. While -Markdown's syntax has been influenced by several existing text-to-HTML -filters -- including Setext, atx, Textile, reStructuredText, -Grutatext, and EtText -- the single biggest source of -inspiration for Markdown's syntax is the format of plain text email.

-

To this end, Markdown's syntax is comprised entirely of punctuation -characters, which punctuation characters have been carefully chosen so -as to look like what they mean. E.g., asterisks around a word actually -look like *emphasis*. Markdown lists look like, well, lists. Even -blockquotes look like quoted passages of text, assuming you've ever -used email.

-

Inline HTML

-

Markdown's syntax is intended for one purpose: to be used as a -format for writing for the web.

-

Markdown is not a replacement for HTML, or even close to it. Its -syntax is very small, corresponding only to a very small subset of -HTML tags. The idea is not to create a syntax that makes it easier -to insert HTML tags. In my opinion, HTML tags are already easy to -insert. The idea for Markdown is to make it easy to read, write, and -edit prose. HTML is a publishing format; Markdown is a writing -format. Thus, Markdown's formatting syntax only addresses issues that -can be conveyed in plain text.

-

For any markup that is not covered by Markdown's syntax, you simply -use HTML itself. There's no need to preface it or delimit it to -indicate that you're switching from Markdown to HTML; you just use -the tags.

-

The only restrictions are that block-level HTML elements -- e.g. <div>, -<table>, <pre>, <p>, etc. -- must be separated from surrounding -content by blank lines, and the start and end tags of the block should -not be indented with tabs or spaces. Markdown is smart enough not -to add extra (unwanted) <p> tags around HTML block-level tags.

-

For example, to add an HTML table to a Markdown article:

-
This is a regular paragraph.
-
-<table>
-    <tr>
-        <td>Foo</td>
-    </tr>
-</table>
-
-This is another regular paragraph.
-
-

Note that Markdown formatting syntax is not processed within block-level -HTML tags. E.g., you can't use Markdown-style *emphasis* inside an -HTML block.

-

Span-level HTML tags -- e.g. <span>, <cite>, or <del> -- can be -used anywhere in a Markdown paragraph, list item, or header. If you -want, you can even use HTML tags instead of Markdown formatting; e.g. if -you'd prefer to use HTML <a> or <img> tags instead of Markdown's -link or image syntax, go right ahead.

-

Unlike block-level HTML tags, Markdown syntax is processed within -span-level tags.

-

Automatic Escaping for Special Characters

-

In HTML, there are two characters that demand special treatment: < -and &. Left angle brackets are used to start tags; ampersands are -used to denote HTML entities. If you want to use them as literal -characters, you must escape them as entities, e.g. &lt;, and -&amp;.

-

Ampersands in particular are bedeviling for web writers. If you want to -write about 'AT&T', you need to write 'AT&amp;T'. You even need to -escape ampersands within URLs. Thus, if you want to link to:

-
http://images.google.com/images?num=30&q=larry+bird
-
-

you need to encode the URL as:

-
http://images.google.com/images?num=30&amp;q=larry+bird
-
-

in your anchor tag href attribute. Needless to say, this is easy to -forget, and is probably the single most common source of HTML validation -errors in otherwise well-marked-up web sites.

-

Markdown allows you to use these characters naturally, taking care of -all the necessary escaping for you. If you use an ampersand as part of -an HTML entity, it remains unchanged; otherwise it will be translated -into &amp;.

-

So, if you want to include a copyright symbol in your article, you can write:

-
&copy;
-
-

and Markdown will leave it alone. But if you write:

-
AT&T
-
-

Markdown will translate it to:

-
AT&amp;T
-
-

Similarly, because Markdown supports inline HTML, if you use -angle brackets as delimiters for HTML tags, Markdown will treat them as -such. But if you write:

-
4 < 5
-
-

Markdown will translate it to:

-
4 &lt; 5
-
-

However, inside Markdown code spans and blocks, angle brackets and -ampersands are always encoded automatically. This makes it easy to use -Markdown to write about HTML code. (As opposed to raw HTML, which is a -terrible format for writing about HTML syntax, because every single < -and & in your example code needs to be escaped.)

-
-

Block Elements

-

Paragraphs and Line Breaks

-

A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing but spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs.

-

The implication of the "one or more consecutive lines of text" rule is -that Markdown supports "hard-wrapped" text paragraphs. This differs -significantly from most other text-to-HTML formatters (including Movable -Type's "Convert Line Breaks" option) which translate every line break -character in a paragraph into a <br /> tag.

-

When you do want to insert a <br /> break tag using Markdown, you -end a line with two or more spaces, then type return.

-

Yes, this takes a tad more effort to create a <br />, but a simplistic -"every line break is a <br />" rule wouldn't work for Markdown. -Markdown's email-style blockquoting and multi-paragraph list items -work best -- and look better -- when you format them with hard breaks.

-

Headers

-

Markdown supports two styles of headers, Setext and atx.

-

Setext-style headers are "underlined" using equal signs (for first-level -headers) and dashes (for second-level headers). For example:

-
This is an H1
-=============
-
-This is an H2
--------------
-
-

Any number of underlining ='s or -'s will work.

-

Atx-style headers use 1-6 hash characters at the start of the line, -corresponding to header levels 1-6. For example:

-
# This is an H1
-
-## This is an H2
-
-###### This is an H6
-
-

Optionally, you may "close" atx-style headers. This is purely -cosmetic -- you can use this if you think it looks better. The -closing hashes don't even need to match the number of hashes -used to open the header. (The number of opening hashes -determines the header level.) :

-
# This is an H1 #
-
-## This is an H2 ##
-
-### This is an H3 ######
-
-

Blockquotes

-

Markdown uses email-style > characters for blockquoting. If you're -familiar with quoting passages of text in an email message, then you -know how to create a blockquote in Markdown. It looks best if you hard -wrap the text and put a > before every line:

-
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
-> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
-> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
-> 
-> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
-> id sem consectetuer libero luctus adipiscing.
-
-

Markdown allows you to be lazy and only put the > before the first -line of a hard-wrapped paragraph:

-
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
-consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
-Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
-
-> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
-id sem consectetuer libero luctus adipiscing.
-
-

Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by -adding additional levels of >:

-
> This is the first level of quoting.
->
-> > This is nested blockquote.
->
-> Back to the first level.
-
-

Blockquotes can contain other Markdown elements, including headers, lists, -and code blocks:

-
> ## This is a header.
-> 
-> 1.   This is the first list item.
-> 2.   This is the second list item.
-> 
-> Here's some example code:
-> 
->     return shell_exec("echo $input | $markdown_script");
-
-

Any decent text editor should make email-style quoting easy. For -example, with BBEdit, you can make a selection and choose Increase -Quote Level from the Text menu.

-

Lists

-

Markdown supports ordered (numbered) and unordered (bulleted) lists.

-

Unordered lists use asterisks, pluses, and hyphens -- interchangably --- as list markers:

-
*   Red
-*   Green
-*   Blue
-
-

is equivalent to:

-
+   Red
-+   Green
-+   Blue
-
-

and:

-
-   Red
--   Green
--   Blue
-
-

Ordered lists use numbers followed by periods:

-
1.  Bird
-2.  McHale
-3.  Parish
-
-

It's important to note that the actual numbers you use to mark the -list have no effect on the HTML output Markdown produces. The HTML -Markdown produces from the above list is:

-
<ol>
-<li>Bird</li>
-<li>McHale</li>
-<li>Parish</li>
-</ol>
-
-

If you instead wrote the list in Markdown like this:

-
1.  Bird
-1.  McHale
-1.  Parish
-
-

or even:

-
3. Bird
-1. McHale
-8. Parish
-
-

you'd get the exact same HTML output. The point is, if you want to, -you can use ordinal numbers in your ordered Markdown lists, so that -the numbers in your source match the numbers in your published HTML. -But if you want to be lazy, you don't have to.

-

If you do use lazy list numbering, however, you should still start the -list with the number 1. At some point in the future, Markdown may support -starting ordered lists at an arbitrary number.

-

List markers typically start at the left margin, but may be indented by -up to three spaces. List markers must be followed by one or more spaces -or a tab.

-

To make lists look nice, you can wrap items with hanging indents:

-
*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
-    Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
-    viverra nec, fringilla in, laoreet vitae, risus.
-*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
-    Suspendisse id sem consectetuer libero luctus adipiscing.
-
-

But if you want to be lazy, you don't have to:

-
*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
-Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
-viverra nec, fringilla in, laoreet vitae, risus.
-*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
-Suspendisse id sem consectetuer libero luctus adipiscing.
-
-

If list items are separated by blank lines, Markdown will wrap the -items in <p> tags in the HTML output. For example, this input:

-
*   Bird
-*   Magic
-
-

will turn into:

-
<ul>
-<li>Bird</li>
-<li>Magic</li>
-</ul>
-
-

But this:

-
*   Bird
-
-*   Magic
-
-

will turn into:

-
<ul>
-<li><p>Bird</p></li>
-<li><p>Magic</p></li>
-</ul>
-
-

List items may consist of multiple paragraphs. Each subsequent -paragraph in a list item must be intended by either 4 spaces -or one tab:

-
1.  This is a list item with two paragraphs. Lorem ipsum dolor
-    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
-    mi posuere lectus.
-
-    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
-    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
-    sit amet velit.
-
-2.  Suspendisse id sem consectetuer libero luctus adipiscing.
-
-

It looks nice if you indent every line of the subsequent -paragraphs, but here again, Markdown will allow you to be -lazy:

-
*   This is a list item with two paragraphs.
-
-    This is the second paragraph in the list item. You're
-only required to indent the first line. Lorem ipsum dolor
-sit amet, consectetuer adipiscing elit.
-
-*   Another item in the same list.
-
-

To put a blockquote within a list item, the blockquote's > -delimiters need to be indented:

-
*   A list item with a blockquote:
-
-    > This is a blockquote
-    > inside a list item.
-
-

To put a code block within a list item, the code block needs -to be indented twice -- 8 spaces or two tabs:

-
*   A list item with a code block:
-
-        <code goes here>
-
-

It's worth noting that it's possible to trigger an ordered list by -accident, by writing something like this:

-
1986. What a great season.
-
-

In other words, a number-period-space sequence at the beginning of a -line. To avoid this, you can backslash-escape the period:

-
1986\. What a great season.
-
-

Code Blocks

-

Pre-formatted code blocks are used for writing about programming or -markup source code. Rather than forming normal paragraphs, the lines -of a code block are interpreted literally. Markdown wraps a code block -in both <pre> and <code> tags.

-

To produce a code block in Markdown, simply indent every line of the -block by at least 4 spaces or 1 tab. For example, given this input:

-
This is a normal paragraph:
-
-    This is a code block.
-
-

Markdown will generate:

-
<p>This is a normal paragraph:</p>
-
-<pre><code>This is a code block.
-</code></pre>
-
-

One level of indentation -- 4 spaces or 1 tab -- is removed from each -line of the code block. For example, this:

-
Here is an example of AppleScript:
-
-    tell application "Foo"
-        beep
-    end tell
-
-

will turn into:

-
<p>Here is an example of AppleScript:</p>
-
-<pre><code>tell application "Foo"
-    beep
-end tell
-</code></pre>
-
-

A code block continues until it reaches a line that is not indented -(or the end of the article).

-

Within a code block, ampersands (&) and angle brackets (< and >) -are automatically converted into HTML entities. This makes it very -easy to include example HTML source code using Markdown -- just paste -it and indent it, and Markdown will handle the hassle of encoding the -ampersands and angle brackets. For example, this:

-
    <div class="footer">
-        &copy; 2004 Foo Corporation
-    </div>
-
-

will turn into:

-
<pre><code>&lt;div class="footer"&gt;
-    &amp;copy; 2004 Foo Corporation
-&lt;/div&gt;
-</code></pre>
-
-

Regular Markdown syntax is not processed within code blocks. E.g., -asterisks are just literal asterisks within a code block. This means -it's also easy to use Markdown to write about Markdown's own syntax.

-

Horizontal Rules

-

You can produce a horizontal rule tag (<hr />) by placing three or -more hyphens, asterisks, or underscores on a line by themselves. If you -wish, you may use spaces between the hyphens or asterisks. Each of the -following lines will produce a horizontal rule:

-
* * *
-
-***
-
-*****
-
-- - -
-
----------------------------------------
-
-_ _ _
-
-
-

Span Elements

- -

Markdown supports two style of links: inline and reference.

-

In both styles, the link text is delimited by [square brackets].

-

To create an inline link, use a set of regular parentheses immediately -after the link text's closing square bracket. Inside the parentheses, -put the URL where you want the link to point, along with an optional -title for the link, surrounded in quotes. For example:

-
This is [an example](http://example.com/ "Title") inline link.
-
-[This link](http://example.net/) has no title attribute.
-
-

Will produce:

-
<p>This is <a href="http://example.com/" title="Title">
-an example</a> inline link.</p>
-
-<p><a href="http://example.net/">This link</a> has no
-title attribute.</p>
-
-

If you're referring to a local resource on the same server, you can -use relative paths:

-
See my [About](/about/) page for details.
-
-

Reference-style links use a second set of square brackets, inside -which you place a label of your choosing to identify the link:

-
This is [an example][id] reference-style link.
-
-

You can optionally use a space to separate the sets of brackets:

-
This is [an example] [id] reference-style link.
-
-

Then, anywhere in the document, you define your link label like this, -on a line by itself:

-
[id]: http://example.com/  "Optional Title Here"
-
-

That is:

-
    -
  • Square brackets containing the link identifier (optionally - indented from the left margin using up to three spaces);
  • -
  • followed by a colon;
  • -
  • followed by one or more spaces (or tabs);
  • -
  • followed by the URL for the link;
  • -
  • optionally followed by a title attribute for the link, enclosed - in double or single quotes.
  • -
-

The link URL may, optionally, be surrounded by angle brackets:

-
[id]: <http://example.com/>  "Optional Title Here"
-
-

You can put the title attribute on the next line and use extra spaces -or tabs for padding, which tends to look better with longer URLs:

-
[id]: http://example.com/longish/path/to/resource/here
-    "Optional Title Here"
-
-

Link definitions are only used for creating links during Markdown -processing, and are stripped from your document in the HTML output.

-

Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are not case sensitive. E.g. these two links:

-
[link text][a]
-[link text][A]
-
-

are equivalent.

-

The implicit link name shortcut allows you to omit the name of the -link, in which case the link text itself is used as the name. -Just use an empty set of square brackets -- e.g., to link the word -"Google" to the google.com web site, you could simply write:

-
[Google][]
-
-

And then define the link:

-
[Google]: http://google.com/
-
-

Because link names may contain spaces, this shortcut even works for -multiple words in the link text:

-
Visit [Daring Fireball][] for more information.
-
-

And then define the link:

-
[Daring Fireball]: http://daringfireball.net/
-
-

Link definitions can be placed anywhere in your Markdown document. I -tend to put them immediately after each paragraph in which they're -used, but if you want, you can put them all at the end of your -document, sort of like footnotes.

-

Here's an example of reference links in action:

-
I get 10 times more traffic from [Google] [1] than from
-[Yahoo] [2] or [MSN] [3].
-
-  [1]: http://google.com/        "Google"
-  [2]: http://search.yahoo.com/  "Yahoo Search"
-  [3]: http://search.msn.com/    "MSN Search"
-
-

Using the implicit link name shortcut, you could instead write:

-
I get 10 times more traffic from [Google][] than from
-[Yahoo][] or [MSN][].
-
-  [google]: http://google.com/        "Google"
-  [yahoo]:  http://search.yahoo.com/  "Yahoo Search"
-  [msn]:    http://search.msn.com/    "MSN Search"
-
-

Both of the above examples will produce the following HTML output:

-
<p>I get 10 times more traffic from <a href="http://google.com/"
-title="Google">Google</a> than from
-<a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
-or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
-
-

For comparison, here is the same paragraph written using -Markdown's inline link style:

-
I get 10 times more traffic from [Google](http://google.com/ "Google")
-than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
-[MSN](http://search.msn.com/ "MSN Search").
-
-

The point of reference-style links is not that they're easier to -write. The point is that with reference-style links, your document -source is vastly more readable. Compare the above examples: using -reference-style links, the paragraph itself is only 81 characters -long; with inline-style links, it's 176 characters; and as raw HTML, -it's 234 characters. In the raw HTML, there's more markup than there -is text.

-

With Markdown's reference-style links, a source document much more -closely resembles the final output, as rendered in a browser. By -allowing you to move the markup-related metadata out of the paragraph, -you can add links without interrupting the narrative flow of your -prose.

-

Emphasis

-

Markdown treats asterisks (*) and underscores (_) as indicators of -emphasis. Text wrapped with one * or _ will be wrapped with an -HTML <em> tag; double *'s or _'s will be wrapped with an HTML -<strong> tag. E.g., this input:

-
*single asterisks*
-
-_single underscores_
-
-**double asterisks**
-
-__double underscores__
-
-

will produce:

-
<em>single asterisks</em>
-
-<em>single underscores</em>
-
-<strong>double asterisks</strong>
-
-<strong>double underscores</strong>
-
-

You can use whichever style you prefer; the lone restriction is that -the same character must be used to open and close an emphasis span.

-

Emphasis can be used in the middle of a word:

-
un*fucking*believable
-
-

But if you surround an * or _ with spaces, it'll be treated as a -literal asterisk or underscore.

-

To produce a literal asterisk or underscore at a position where it -would otherwise be used as an emphasis delimiter, you can backslash -escape it:

-
\*this text is surrounded by literal asterisks\*
-
-

Code

-

To indicate a span of code, wrap it with backtick quotes (`). -Unlike a pre-formatted code block, a code span indicates code within a -normal paragraph. For example:

-
Use the `printf()` function.
-
-

will produce:

-
<p>Use the <code>printf()</code> function.</p>
-
-

To include a literal backtick character within a code span, you can use -multiple backticks as the opening and closing delimiters:

-
``There is a literal backtick (`) here.``
-
-

which will produce this:

-
<p><code>There is a literal backtick (`) here.</code></p>
-
-

The backtick delimiters surrounding a code span may include spaces -- -one after the opening, one before the closing. This allows you to place -literal backtick characters at the beginning or end of a code span:

-
A single backtick in a code span: `` ` ``
-
-A backtick-delimited string in a code span: `` `foo` ``
-
-

will produce:

-
<p>A single backtick in a code span: <code>`</code></p>
-
-<p>A backtick-delimited string in a code span: <code>`foo`</code></p>
-
-

With a code span, ampersands and angle brackets are encoded as HTML -entities automatically, which makes it easy to include example HTML -tags. Markdown will turn this:

-
Please don't use any `<blink>` tags.
-
-

into:

-
<p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
-
-

You can write this:

-
`&#8212;` is the decimal-encoded equivalent of `&mdash;`.
-
-

to produce:

-
<p><code>&amp;#8212;</code> is the decimal-encoded
-equivalent of <code>&amp;mdash;</code>.</p>
-
-

Images

-

Admittedly, it's fairly difficult to devise a "natural" syntax for -placing images into a plain text document format.

-

Markdown uses an image syntax that is intended to resemble the syntax -for links, allowing for two styles: inline and reference.

-

Inline image syntax looks like this:

-
![Alt text](/path/to/img.jpg)
-
-![Alt text](/path/to/img.jpg "Optional title")
-
-

That is:

-
    -
  • An exclamation mark: !;
  • -
  • followed by a set of square brackets, containing the alt - attribute text for the image;
  • -
  • followed by a set of parentheses, containing the URL or path to - the image, and an optional title attribute enclosed in double - or single quotes.
  • -
-

Reference-style image syntax looks like this:

-
![Alt text][id]
-
-

Where "id" is the name of a defined image reference. Image references -are defined using syntax identical to link references:

-
[id]: url/to/image  "Optional title attribute"
-
-

As of this writing, Markdown has no syntax for specifying the -dimensions of an image; if this is important to you, you can simply -use regular HTML <img> tags.

-
-

Miscellaneous

- -

Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:

-
<http://example.com/>
-
-

Markdown will turn this into:

-
<a href="http://example.com/">http://example.com/</a>
-
-

Automatic links for email addresses work similarly, except that -Markdown will also perform a bit of randomized decimal and hex -entity-encoding to help obscure your address from address-harvesting -spambots. For example, Markdown will turn this:

-
<address@example.com>
-
-

into something like this:

-
<a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65;
-&#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;
-&#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61;
-&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a>
-
-

which will render in a browser as a clickable link to "address@example.com".

-

(This sort of entity-encoding trick will indeed fool many, if not -most, address-harvesting bots, but it definitely won't fool all of -them. It's better than nothing, but an address published in this way -will probably eventually start receiving spam.)

-

Backslash Escapes

-

Markdown allows you to use backslash escapes to generate literal -characters which would otherwise have special meaning in Markdown's -formatting syntax. For example, if you wanted to surround a word with -literal asterisks (instead of an HTML <em> tag), you can backslashes -before the asterisks, like this:

-
\*literal asterisks\*
-
-

Markdown provides backslash escapes for the following characters:

-
\   backslash
-`   backtick
-*   asterisk
-_   underscore
-{}  curly braces
-[]  square brackets
-()  parentheses
-#   hash mark
-+   plus sign
--   minus sign (hyphen)
-.   dot
-!   exclamation mark
-
\ No newline at end of file diff --git a/tests/extensions-x-toc/syntax-toc.txt b/tests/extensions-x-toc/syntax-toc.txt deleted file mode 100644 index f297200..0000000 --- a/tests/extensions-x-toc/syntax-toc.txt +++ /dev/null @@ -1,851 +0,0 @@ - -[TOC] - -# Overview - -## Philosophy - -Markdown is intended to be as easy-to-read and easy-to-write as is feasible. - -Readability, however, is emphasized above all else. A Markdown-formatted -document should be publishable as-is, as plain text, without looking -like it's been marked up with tags or formatting instructions. While -Markdown's syntax has been influenced by several existing text-to-HTML -filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4], -[Grutatext] [5], and [EtText] [6] -- the single biggest source of -inspiration for Markdown's syntax is the format of plain text email. - - [1]: http://docutils.sourceforge.net/mirror/setext.html - [2]: http://www.aaronsw.com/2002/atx/ - [3]: http://textism.com/tools/textile/ - [4]: http://docutils.sourceforge.net/rst.html - [5]: http://www.triptico.com/software/grutatxt.html - [6]: http://ettext.taint.org/doc/ - -To this end, Markdown's syntax is comprised entirely of punctuation -characters, which punctuation characters have been carefully chosen so -as to look like what they mean. E.g., asterisks around a word actually -look like \*emphasis\*. Markdown lists look like, well, lists. Even -blockquotes look like quoted passages of text, assuming you've ever -used email. - - - -## Inline HTML - -Markdown's syntax is intended for one purpose: to be used as a -format for *writing* for the web. - -Markdown is not a replacement for HTML, or even close to it. Its -syntax is very small, corresponding only to a very small subset of -HTML tags. The idea is *not* to create a syntax that makes it easier -to insert HTML tags. In my opinion, HTML tags are already easy to -insert. The idea for Markdown is to make it easy to read, write, and -edit prose. HTML is a *publishing* format; Markdown is a *writing* -format. Thus, Markdown's formatting syntax only addresses issues that -can be conveyed in plain text. - -For any markup that is not covered by Markdown's syntax, you simply -use HTML itself. There's no need to preface it or delimit it to -indicate that you're switching from Markdown to HTML; you just use -the tags. - -The only restrictions are that block-level HTML elements -- e.g. `
`, -``, `
`, `

`, etc. -- must be separated from surrounding -content by blank lines, and the start and end tags of the block should -not be indented with tabs or spaces. Markdown is smart enough not -to add extra (unwanted) `

` tags around HTML block-level tags. - -For example, to add an HTML table to a Markdown article: - - This is a regular paragraph. - -

- - - -
Foo
- - This is another regular paragraph. - -Note that Markdown formatting syntax is not processed within block-level -HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an -HTML block. - -Span-level HTML tags -- e.g. ``, ``, or `` -- can be -used anywhere in a Markdown paragraph, list item, or header. If you -want, you can even use HTML tags instead of Markdown formatting; e.g. if -you'd prefer to use HTML `` or `` tags instead of Markdown's -link or image syntax, go right ahead. - -Unlike block-level HTML tags, Markdown syntax *is* processed within -span-level tags. - - -## Automatic Escaping for Special Characters - -In HTML, there are two characters that demand special treatment: `<` -and `&`. Left angle brackets are used to start tags; ampersands are -used to denote HTML entities. If you want to use them as literal -characters, you must escape them as entities, e.g. `<`, and -`&`. - -Ampersands in particular are bedeviling for web writers. If you want to -write about 'AT&T', you need to write '`AT&T`'. You even need to -escape ampersands within URLs. Thus, if you want to link to: - - http://images.google.com/images?num=30&q=larry+bird - -you need to encode the URL as: - - http://images.google.com/images?num=30&q=larry+bird - -in your anchor tag `href` attribute. Needless to say, this is easy to -forget, and is probably the single most common source of HTML validation -errors in otherwise well-marked-up web sites. - -Markdown allows you to use these characters naturally, taking care of -all the necessary escaping for you. If you use an ampersand as part of -an HTML entity, it remains unchanged; otherwise it will be translated -into `&`. - -So, if you want to include a copyright symbol in your article, you can write: - - © - -and Markdown will leave it alone. But if you write: - - AT&T - -Markdown will translate it to: - - AT&T - -Similarly, because Markdown supports [inline HTML](#html), if you use -angle brackets as delimiters for HTML tags, Markdown will treat them as -such. But if you write: - - 4 < 5 - -Markdown will translate it to: - - 4 < 5 - -However, inside Markdown code spans and blocks, angle brackets and -ampersands are *always* encoded automatically. This makes it easy to use -Markdown to write about HTML code. (As opposed to raw HTML, which is a -terrible format for writing about HTML syntax, because every single `<` -and `&` in your example code needs to be escaped.) - - -* * * - - -# Block Elements - - -## Paragraphs and Line Breaks - -A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing but spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs. - -The implication of the "one or more consecutive lines of text" rule is -that Markdown supports "hard-wrapped" text paragraphs. This differs -significantly from most other text-to-HTML formatters (including Movable -Type's "Convert Line Breaks" option) which translate every line break -character in a paragraph into a `
` tag. - -When you *do* want to insert a `
` break tag using Markdown, you -end a line with two or more spaces, then type return. - -Yes, this takes a tad more effort to create a `
`, but a simplistic -"every line break is a `
`" rule wouldn't work for Markdown. -Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l] -work best -- and look better -- when you format them with hard breaks. - - [bq]: #blockquote - [l]: #list - - - -## Headers - -Markdown supports two styles of headers, [Setext] [1] and [atx] [2]. - -Setext-style headers are "underlined" using equal signs (for first-level -headers) and dashes (for second-level headers). For example: - - This is an H1 - ============= - - This is an H2 - ------------- - -Any number of underlining `=`'s or `-`'s will work. - -Atx-style headers use 1-6 hash characters at the start of the line, -corresponding to header levels 1-6. For example: - - # This is an H1 - - ## This is an H2 - - ###### This is an H6 - -Optionally, you may "close" atx-style headers. This is purely -cosmetic -- you can use this if you think it looks better. The -closing hashes don't even need to match the number of hashes -used to open the header. (The number of opening hashes -determines the header level.) : - - # This is an H1 # - - ## This is an H2 ## - - ### This is an H3 ###### - - -## Blockquotes - -Markdown uses email-style `>` characters for blockquoting. If you're -familiar with quoting passages of text in an email message, then you -know how to create a blockquote in Markdown. It looks best if you hard -wrap the text and put a `>` before every line: - - > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, - > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. - > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. - > - > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse - > id sem consectetuer libero luctus adipiscing. - -Markdown allows you to be lazy and only put the `>` before the first -line of a hard-wrapped paragraph: - - > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, - consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. - Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. - - > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse - id sem consectetuer libero luctus adipiscing. - -Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by -adding additional levels of `>`: - - > This is the first level of quoting. - > - > > This is nested blockquote. - > - > Back to the first level. - -Blockquotes can contain other Markdown elements, including headers, lists, -and code blocks: - - > ## This is a header. - > - > 1. This is the first list item. - > 2. This is the second list item. - > - > Here's some example code: - > - > return shell_exec("echo $input | $markdown_script"); - -Any decent text editor should make email-style quoting easy. For -example, with BBEdit, you can make a selection and choose Increase -Quote Level from the Text menu. - - -## Lists - -Markdown supports ordered (numbered) and unordered (bulleted) lists. - -Unordered lists use asterisks, pluses, and hyphens -- interchangably --- as list markers: - - * Red - * Green - * Blue - -is equivalent to: - - + Red - + Green - + Blue - -and: - - - Red - - Green - - Blue - -Ordered lists use numbers followed by periods: - - 1. Bird - 2. McHale - 3. Parish - -It's important to note that the actual numbers you use to mark the -list have no effect on the HTML output Markdown produces. The HTML -Markdown produces from the above list is: - -
    -
  1. Bird
  2. -
  3. McHale
  4. -
  5. Parish
  6. -
- -If you instead wrote the list in Markdown like this: - - 1. Bird - 1. McHale - 1. Parish - -or even: - - 3. Bird - 1. McHale - 8. Parish - -you'd get the exact same HTML output. The point is, if you want to, -you can use ordinal numbers in your ordered Markdown lists, so that -the numbers in your source match the numbers in your published HTML. -But if you want to be lazy, you don't have to. - -If you do use lazy list numbering, however, you should still start the -list with the number 1. At some point in the future, Markdown may support -starting ordered lists at an arbitrary number. - -List markers typically start at the left margin, but may be indented by -up to three spaces. List markers must be followed by one or more spaces -or a tab. - -To make lists look nice, you can wrap items with hanging indents: - - * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. - Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, - viverra nec, fringilla in, laoreet vitae, risus. - * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. - Suspendisse id sem consectetuer libero luctus adipiscing. - -But if you want to be lazy, you don't have to: - - * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. - Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, - viverra nec, fringilla in, laoreet vitae, risus. - * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. - Suspendisse id sem consectetuer libero luctus adipiscing. - -If list items are separated by blank lines, Markdown will wrap the -items in `

` tags in the HTML output. For example, this input: - - * Bird - * Magic - -will turn into: - -

    -
  • Bird
  • -
  • Magic
  • -
- -But this: - - * Bird - - * Magic - -will turn into: - -
    -
  • Bird

  • -
  • Magic

  • -
- -List items may consist of multiple paragraphs. Each subsequent -paragraph in a list item must be intended by either 4 spaces -or one tab: - - 1. This is a list item with two paragraphs. Lorem ipsum dolor - sit amet, consectetuer adipiscing elit. Aliquam hendrerit - mi posuere lectus. - - Vestibulum enim wisi, viverra nec, fringilla in, laoreet - vitae, risus. Donec sit amet nisl. Aliquam semper ipsum - sit amet velit. - - 2. Suspendisse id sem consectetuer libero luctus adipiscing. - -It looks nice if you indent every line of the subsequent -paragraphs, but here again, Markdown will allow you to be -lazy: - - * This is a list item with two paragraphs. - - This is the second paragraph in the list item. You're - only required to indent the first line. Lorem ipsum dolor - sit amet, consectetuer adipiscing elit. - - * Another item in the same list. - -To put a blockquote within a list item, the blockquote's `>` -delimiters need to be indented: - - * A list item with a blockquote: - - > This is a blockquote - > inside a list item. - -To put a code block within a list item, the code block needs -to be indented *twice* -- 8 spaces or two tabs: - - * A list item with a code block: - - - - -It's worth noting that it's possible to trigger an ordered list by -accident, by writing something like this: - - 1986. What a great season. - -In other words, a *number-period-space* sequence at the beginning of a -line. To avoid this, you can backslash-escape the period: - - 1986\. What a great season. - - - -## Code Blocks - -Pre-formatted code blocks are used for writing about programming or -markup source code. Rather than forming normal paragraphs, the lines -of a code block are interpreted literally. Markdown wraps a code block -in both `
` and `` tags.
-
-To produce a code block in Markdown, simply indent every line of the
-block by at least 4 spaces or 1 tab. For example, given this input:
-
-    This is a normal paragraph:
-
-        This is a code block.
-
-Markdown will generate:
-
-    

This is a normal paragraph:

- -
This is a code block.
-    
- -One level of indentation -- 4 spaces or 1 tab -- is removed from each -line of the code block. For example, this: - - Here is an example of AppleScript: - - tell application "Foo" - beep - end tell - -will turn into: - -

Here is an example of AppleScript:

- -
tell application "Foo"
-        beep
-    end tell
-    
- -A code block continues until it reaches a line that is not indented -(or the end of the article). - -Within a code block, ampersands (`&`) and angle brackets (`<` and `>`) -are automatically converted into HTML entities. This makes it very -easy to include example HTML source code using Markdown -- just paste -it and indent it, and Markdown will handle the hassle of encoding the -ampersands and angle brackets. For example, this: - - - -will turn into: - -
<div class="footer">
-        &copy; 2004 Foo Corporation
-    </div>
-    
- -Regular Markdown syntax is not processed within code blocks. E.g., -asterisks are just literal asterisks within a code block. This means -it's also easy to use Markdown to write about Markdown's own syntax. - - - -## Horizontal Rules - -You can produce a horizontal rule tag (`
`) by placing three or -more hyphens, asterisks, or underscores on a line by themselves. If you -wish, you may use spaces between the hyphens or asterisks. Each of the -following lines will produce a horizontal rule: - - * * * - - *** - - ***** - - - - - - - --------------------------------------- - - _ _ _ - - -* * * - -# Span Elements - -## Links - -Markdown supports two style of links: *inline* and *reference*. - -In both styles, the link text is delimited by [square brackets]. - -To create an inline link, use a set of regular parentheses immediately -after the link text's closing square bracket. Inside the parentheses, -put the URL where you want the link to point, along with an *optional* -title for the link, surrounded in quotes. For example: - - This is [an example](http://example.com/ "Title") inline link. - - [This link](http://example.net/) has no title attribute. - -Will produce: - -

This is - an example inline link.

- -

This link has no - title attribute.

- -If you're referring to a local resource on the same server, you can -use relative paths: - - See my [About](/about/) page for details. - -Reference-style links use a second set of square brackets, inside -which you place a label of your choosing to identify the link: - - This is [an example][id] reference-style link. - -You can optionally use a space to separate the sets of brackets: - - This is [an example] [id] reference-style link. - -Then, anywhere in the document, you define your link label like this, -on a line by itself: - - [id]: http://example.com/ "Optional Title Here" - -That is: - -* Square brackets containing the link identifier (optionally - indented from the left margin using up to three spaces); -* followed by a colon; -* followed by one or more spaces (or tabs); -* followed by the URL for the link; -* optionally followed by a title attribute for the link, enclosed - in double or single quotes. - -The link URL may, optionally, be surrounded by angle brackets: - - [id]: "Optional Title Here" - -You can put the title attribute on the next line and use extra spaces -or tabs for padding, which tends to look better with longer URLs: - - [id]: http://example.com/longish/path/to/resource/here - "Optional Title Here" - -Link definitions are only used for creating links during Markdown -processing, and are stripped from your document in the HTML output. - -Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are *not* case sensitive. E.g. these two links: - - [link text][a] - [link text][A] - -are equivalent. - -The *implicit link name* shortcut allows you to omit the name of the -link, in which case the link text itself is used as the name. -Just use an empty set of square brackets -- e.g., to link the word -"Google" to the google.com web site, you could simply write: - - [Google][] - -And then define the link: - - [Google]: http://google.com/ - -Because link names may contain spaces, this shortcut even works for -multiple words in the link text: - - Visit [Daring Fireball][] for more information. - -And then define the link: - - [Daring Fireball]: http://daringfireball.net/ - -Link definitions can be placed anywhere in your Markdown document. I -tend to put them immediately after each paragraph in which they're -used, but if you want, you can put them all at the end of your -document, sort of like footnotes. - -Here's an example of reference links in action: - - I get 10 times more traffic from [Google] [1] than from - [Yahoo] [2] or [MSN] [3]. - - [1]: http://google.com/ "Google" - [2]: http://search.yahoo.com/ "Yahoo Search" - [3]: http://search.msn.com/ "MSN Search" - -Using the implicit link name shortcut, you could instead write: - - I get 10 times more traffic from [Google][] than from - [Yahoo][] or [MSN][]. - - [google]: http://google.com/ "Google" - [yahoo]: http://search.yahoo.com/ "Yahoo Search" - [msn]: http://search.msn.com/ "MSN Search" - -Both of the above examples will produce the following HTML output: - -

I get 10 times more traffic from Google than from - Yahoo - or MSN.

- -For comparison, here is the same paragraph written using -Markdown's inline link style: - - I get 10 times more traffic from [Google](http://google.com/ "Google") - than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or - [MSN](http://search.msn.com/ "MSN Search"). - -The point of reference-style links is not that they're easier to -write. The point is that with reference-style links, your document -source is vastly more readable. Compare the above examples: using -reference-style links, the paragraph itself is only 81 characters -long; with inline-style links, it's 176 characters; and as raw HTML, -it's 234 characters. In the raw HTML, there's more markup than there -is text. - -With Markdown's reference-style links, a source document much more -closely resembles the final output, as rendered in a browser. By -allowing you to move the markup-related metadata out of the paragraph, -you can add links without interrupting the narrative flow of your -prose. - - -## Emphasis - -Markdown treats asterisks (`*`) and underscores (`_`) as indicators of -emphasis. Text wrapped with one `*` or `_` will be wrapped with an -HTML `` tag; double `*`'s or `_`'s will be wrapped with an HTML -`` tag. E.g., this input: - - *single asterisks* - - _single underscores_ - - **double asterisks** - - __double underscores__ - -will produce: - - single asterisks - - single underscores - - double asterisks - - double underscores - -You can use whichever style you prefer; the lone restriction is that -the same character must be used to open and close an emphasis span. - -Emphasis can be used in the middle of a word: - - un*fucking*believable - -But if you surround an `*` or `_` with spaces, it'll be treated as a -literal asterisk or underscore. - -To produce a literal asterisk or underscore at a position where it -would otherwise be used as an emphasis delimiter, you can backslash -escape it: - - \*this text is surrounded by literal asterisks\* - - - -## Code - -To indicate a span of code, wrap it with backtick quotes (`` ` ``). -Unlike a pre-formatted code block, a code span indicates code within a -normal paragraph. For example: - - Use the `printf()` function. - -will produce: - -

Use the printf() function.

- -To include a literal backtick character within a code span, you can use -multiple backticks as the opening and closing delimiters: - - ``There is a literal backtick (`) here.`` - -which will produce this: - -

There is a literal backtick (`) here.

- -The backtick delimiters surrounding a code span may include spaces -- -one after the opening, one before the closing. This allows you to place -literal backtick characters at the beginning or end of a code span: - - A single backtick in a code span: `` ` `` - - A backtick-delimited string in a code span: `` `foo` `` - -will produce: - -

A single backtick in a code span: `

- -

A backtick-delimited string in a code span: `foo`

- -With a code span, ampersands and angle brackets are encoded as HTML -entities automatically, which makes it easy to include example HTML -tags. Markdown will turn this: - - Please don't use any `` tags. - -into: - -

Please don't use any <blink> tags.

- -You can write this: - - `—` is the decimal-encoded equivalent of `—`. - -to produce: - -

&#8212; is the decimal-encoded - equivalent of &mdash;.

- - - -## Images - -Admittedly, it's fairly difficult to devise a "natural" syntax for -placing images into a plain text document format. - -Markdown uses an image syntax that is intended to resemble the syntax -for links, allowing for two styles: *inline* and *reference*. - -Inline image syntax looks like this: - - ![Alt text](/path/to/img.jpg) - - ![Alt text](/path/to/img.jpg "Optional title") - -That is: - -* An exclamation mark: `!`; -* followed by a set of square brackets, containing the `alt` - attribute text for the image; -* followed by a set of parentheses, containing the URL or path to - the image, and an optional `title` attribute enclosed in double - or single quotes. - -Reference-style image syntax looks like this: - - ![Alt text][id] - -Where "id" is the name of a defined image reference. Image references -are defined using syntax identical to link references: - - [id]: url/to/image "Optional title attribute" - -As of this writing, Markdown has no syntax for specifying the -dimensions of an image; if this is important to you, you can simply -use regular HTML `` tags. - - -* * * - - -# Miscellaneous - -## Automatic Links - -Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this: - - - -Markdown will turn this into: - - http://example.com/ - -Automatic links for email addresses work similarly, except that -Markdown will also perform a bit of randomized decimal and hex -entity-encoding to help obscure your address from address-harvesting -spambots. For example, Markdown will turn this: - - - -into something like this: - - address@exa - mple.com - -which will render in a browser as a clickable link to "address@example.com". - -(This sort of entity-encoding trick will indeed fool many, if not -most, address-harvesting bots, but it definitely won't fool all of -them. It's better than nothing, but an address published in this way -will probably eventually start receiving spam.) - - - -## Backslash Escapes - -Markdown allows you to use backslash escapes to generate literal -characters which would otherwise have special meaning in Markdown's -formatting syntax. For example, if you wanted to surround a word with -literal asterisks (instead of an HTML `` tag), you can backslashes -before the asterisks, like this: - - \*literal asterisks\* - -Markdown provides backslash escapes for the following characters: - - \ backslash - ` backtick - * asterisk - _ underscore - {} curly braces - [] square brackets - () parentheses - # hash mark - + plus sign - - minus sign (hyphen) - . dot - ! exclamation mark - diff --git a/tests/extensions-x-toc/test.cfg b/tests/extensions-x-toc/test.cfg deleted file mode 100644 index e4bc0fe..0000000 --- a/tests/extensions-x-toc/test.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[DEFAULT] -extensions=toc diff --git a/tests/extensions-x-wikilinks/test.cfg b/tests/extensions-x-wikilinks/test.cfg deleted file mode 100644 index 959f38a..0000000 --- a/tests/extensions-x-wikilinks/test.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[DEFAULT] -extensions=wikilinks diff --git a/tests/extensions-x-wikilinks/wikilinks.html b/tests/extensions-x-wikilinks/wikilinks.html deleted file mode 100644 index a76a693..0000000 --- a/tests/extensions-x-wikilinks/wikilinks.html +++ /dev/null @@ -1,9 +0,0 @@ -

Some text with a WikiLink.

-

A link with white space and_underscores and a empty one.

-

Another with double spaces and double__underscores and -one that has emphasis inside and one with_multiple_underscores -and one that is emphasised.

-

And a RealLink.

-

http://example.com/And_A_AutoLink

-

And a MarkdownLink for -completeness.

\ No newline at end of file diff --git a/tests/extensions-x-wikilinks/wikilinks.txt b/tests/extensions-x-wikilinks/wikilinks.txt deleted file mode 100644 index 8e6911b..0000000 --- a/tests/extensions-x-wikilinks/wikilinks.txt +++ /dev/null @@ -1,14 +0,0 @@ -Some text with a [[WikiLink]]. - -A link with [[ white space and_underscores ]] and a empty [[ ]] one. - -Another with [[double spaces]] and [[double__underscores]] and -one that [[has _emphasis_ inside]] and one [[with_multiple_underscores]] -and one that is _[[emphasised]]_. - -And a RealLink. - - - -And a [MarkdownLink](/MarkdownLink/ "A MarkdownLink") for -completeness. diff --git a/tests/html4/html4.html b/tests/html4/html4.html deleted file mode 100644 index 7c88ad7..0000000 --- a/tests/html4/html4.html +++ /dev/null @@ -1,2 +0,0 @@ -

A test of the most
-basic of html/xhtml differences.

\ No newline at end of file diff --git a/tests/html4/html4.txt b/tests/html4/html4.txt deleted file mode 100644 index fddaf8e..0000000 --- a/tests/html4/html4.txt +++ /dev/null @@ -1,2 +0,0 @@ -A test of the most -basic of html/xhtml differences. \ No newline at end of file diff --git a/tests/html4/test.cfg b/tests/html4/test.cfg deleted file mode 100644 index a3fc498..0000000 --- a/tests/html4/test.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[DEFAULT] -output_format=html4 diff --git a/tests/markdown-test/amps-and-angle-encoding.html b/tests/markdown-test/amps-and-angle-encoding.html deleted file mode 100644 index 2c466c1..0000000 --- a/tests/markdown-test/amps-and-angle-encoding.html +++ /dev/null @@ -1,9 +0,0 @@ -

AT&T has an ampersand in their name.

-

AT&T is another way to write it.

-

This & that.

-

4 < 5.

-

6 > 5.

-

Here's a link with an ampersand in the URL.

-

Here's a link with an amersand in the link text: AT&T.

-

Here's an inline link.

-

Here's an inline link.

\ No newline at end of file diff --git a/tests/markdown-test/amps-and-angle-encoding.txt b/tests/markdown-test/amps-and-angle-encoding.txt deleted file mode 100644 index 0e9527f..0000000 --- a/tests/markdown-test/amps-and-angle-encoding.txt +++ /dev/null @@ -1,21 +0,0 @@ -AT&T has an ampersand in their name. - -AT&T is another way to write it. - -This & that. - -4 < 5. - -6 > 5. - -Here's a [link] [1] with an ampersand in the URL. - -Here's a link with an amersand in the link text: [AT&T] [2]. - -Here's an inline [link](/script?foo=1&bar=2). - -Here's an inline [link](). - - -[1]: http://example.com/?foo=1&bar=2 -[2]: http://att.com/ "AT&T" \ No newline at end of file diff --git a/tests/markdown-test/angle-links-and-img.html b/tests/markdown-test/angle-links-and-img.html deleted file mode 100644 index 1ca3b0b..0000000 --- a/tests/markdown-test/angle-links-and-img.html +++ /dev/null @@ -1,4 +0,0 @@ -

link -image -link -image

\ No newline at end of file diff --git a/tests/markdown-test/angle-links-and-img.txt b/tests/markdown-test/angle-links-and-img.txt deleted file mode 100644 index 1dbf404..0000000 --- a/tests/markdown-test/angle-links-and-img.txt +++ /dev/null @@ -1,4 +0,0 @@ -[link]( "title") -![image]() -[link]() -![image]() diff --git a/tests/markdown-test/auto-links.html b/tests/markdown-test/auto-links.html deleted file mode 100644 index 7481fe2..0000000 --- a/tests/markdown-test/auto-links.html +++ /dev/null @@ -1,15 +0,0 @@ -

Link: http://example.com/.

-

Https link: https://example.com

-

Ftp link: ftp://example.com

-

With an ampersand: http://example.com/?foo=1&bar=2

- -
-

Blockquoted: http://example.com/

-
-

Auto-links should not occur here: <http://example.com/>

-
or here: <http://example.com/>
-
\ No newline at end of file diff --git a/tests/markdown-test/auto-links.txt b/tests/markdown-test/auto-links.txt deleted file mode 100644 index a188b40..0000000 --- a/tests/markdown-test/auto-links.txt +++ /dev/null @@ -1,17 +0,0 @@ -Link: . - -Https link: - -Ftp link: - -With an ampersand: - -* In a list? -* -* It should. - -> Blockquoted: - -Auto-links should not occur here: `` - - or here: diff --git a/tests/markdown-test/backlash-escapes.html b/tests/markdown-test/backlash-escapes.html deleted file mode 100644 index 876775f..0000000 --- a/tests/markdown-test/backlash-escapes.html +++ /dev/null @@ -1,67 +0,0 @@ -

These should all get escaped:

-

Backslash: \

-

Backtick: `

-

Asterisk: *

-

Underscore: _

-

Left brace: {

-

Right brace: }

-

Left bracket: [

-

Right bracket: ]

-

Left paren: (

-

Right paren: )

-

Greater-than: >

-

Hash: #

-

Period: .

-

Bang: !

-

Plus: +

-

Minus: -

-

These should not, because they occur within a code block:

-
Backslash: \\
-
-Backtick: \`
-
-Asterisk: \*
-
-Underscore: \_
-
-Left brace: \{
-
-Right brace: \}
-
-Left bracket: \[
-
-Right bracket: \]
-
-Left paren: \(
-
-Right paren: \)
-
-Greater-than: \>
-
-Hash: \#
-
-Period: \.
-
-Bang: \!
-
-Plus: \+
-
-Minus: \-
-
-

Nor should these, which occur in code spans:

-

Backslash: \\

-

Backtick: \`

-

Asterisk: \*

-

Underscore: \_

-

Left brace: \{

-

Right brace: \}

-

Left bracket: \[

-

Right bracket: \]

-

Left paren: \(

-

Right paren: \)

-

Greater-than: \>

-

Hash: \#

-

Period: \.

-

Bang: \!

-

Plus: \+

-

Minus: \-

\ No newline at end of file diff --git a/tests/markdown-test/backlash-escapes.txt b/tests/markdown-test/backlash-escapes.txt deleted file mode 100644 index 16447a0..0000000 --- a/tests/markdown-test/backlash-escapes.txt +++ /dev/null @@ -1,104 +0,0 @@ -These should all get escaped: - -Backslash: \\ - -Backtick: \` - -Asterisk: \* - -Underscore: \_ - -Left brace: \{ - -Right brace: \} - -Left bracket: \[ - -Right bracket: \] - -Left paren: \( - -Right paren: \) - -Greater-than: \> - -Hash: \# - -Period: \. - -Bang: \! - -Plus: \+ - -Minus: \- - - - -These should not, because they occur within a code block: - - Backslash: \\ - - Backtick: \` - - Asterisk: \* - - Underscore: \_ - - Left brace: \{ - - Right brace: \} - - Left bracket: \[ - - Right bracket: \] - - Left paren: \( - - Right paren: \) - - Greater-than: \> - - Hash: \# - - Period: \. - - Bang: \! - - Plus: \+ - - Minus: \- - - -Nor should these, which occur in code spans: - -Backslash: `\\` - -Backtick: `` \` `` - -Asterisk: `\*` - -Underscore: `\_` - -Left brace: `\{` - -Right brace: `\}` - -Left bracket: `\[` - -Right bracket: `\]` - -Left paren: `\(` - -Right paren: `\)` - -Greater-than: `\>` - -Hash: `\#` - -Period: `\.` - -Bang: `\!` - -Plus: `\+` - -Minus: `\-` diff --git a/tests/markdown-test/benchmark.dat b/tests/markdown-test/benchmark.dat deleted file mode 100644 index 3d549dd..0000000 --- a/tests/markdown-test/benchmark.dat +++ /dev/null @@ -1,20 +0,0 @@ -construction:0.000000:0.000000 -amps-and-angle-encoding:0.070000:131072.000000 -auto-links:0.080000:397312.000000 -backlash-escapes:0.270000:884736.000000 -blockquotes-with-dode-blocks:0.020000:0.000000 -hard-wrapped:0.020000:0.000000 -horizontal-rules:0.180000:135168.000000 -inline-html-advanced:0.070000:0.000000 -inline-html-comments:0.080000:0.000000 -inline-html-simple:0.210000:0.000000 -links-inline:0.140000:0.000000 -links-reference:0.170000:0.000000 -literal-quotes:0.090000:0.000000 -markdown-documentation-basics:0.690000:1806336.000000 -markdown-syntax:3.310000:6696960.000000 -nested-blockquotes:0.200000:0.000000 -ordered-and-unordered-list:0.530000:0.000000 -strong-and-em-together:0.200000:0.000000 -tabs:0.200000:0.000000 -tidyness:0.200000:0.000000 diff --git a/tests/markdown-test/blockquotes-with-code-blocks.html b/tests/markdown-test/blockquotes-with-code-blocks.html deleted file mode 100644 index 5fc98b1..0000000 --- a/tests/markdown-test/blockquotes-with-code-blocks.html +++ /dev/null @@ -1,12 +0,0 @@ -
-

Example:

-
sub status {
-    print "working";
-}
-
-

Or:

-
sub status {
-    return "working";
-}
-
-
\ No newline at end of file diff --git a/tests/markdown-test/blockquotes-with-code-blocks.txt b/tests/markdown-test/blockquotes-with-code-blocks.txt deleted file mode 100644 index c31d171..0000000 --- a/tests/markdown-test/blockquotes-with-code-blocks.txt +++ /dev/null @@ -1,11 +0,0 @@ -> Example: -> -> sub status { -> print "working"; -> } -> -> Or: -> -> sub status { -> return "working"; -> } diff --git a/tests/markdown-test/codeblock-in-list.html b/tests/markdown-test/codeblock-in-list.html deleted file mode 100644 index 49edd56..0000000 --- a/tests/markdown-test/codeblock-in-list.html +++ /dev/null @@ -1,14 +0,0 @@ -
    -
  • -

    A list item with a code block

    -
    Some *code*
    -
    -
  • -
  • -

    Another list item

    -
    More code
    -
    -And more code
    -
    -
  • -
\ No newline at end of file diff --git a/tests/markdown-test/codeblock-in-list.txt b/tests/markdown-test/codeblock-in-list.txt deleted file mode 100644 index 87d4e3b..0000000 --- a/tests/markdown-test/codeblock-in-list.txt +++ /dev/null @@ -1,10 +0,0 @@ -* A list item with a code block - - Some *code* - -* Another list item - - More code - - And more code - diff --git a/tests/markdown-test/hard-wrapped.html b/tests/markdown-test/hard-wrapped.html deleted file mode 100644 index e28e900..0000000 --- a/tests/markdown-test/hard-wrapped.html +++ /dev/null @@ -1,7 +0,0 @@ -

In Markdown 1.0.0 and earlier. Version -8. This line turns into a list item. -Because a hard-wrapped line in the -middle of a paragraph looked like a -list item.

-

Here's one with a bullet. -* criminey.

\ No newline at end of file diff --git a/tests/markdown-test/hard-wrapped.txt b/tests/markdown-test/hard-wrapped.txt deleted file mode 100644 index f8a5b27..0000000 --- a/tests/markdown-test/hard-wrapped.txt +++ /dev/null @@ -1,8 +0,0 @@ -In Markdown 1.0.0 and earlier. Version -8. This line turns into a list item. -Because a hard-wrapped line in the -middle of a paragraph looked like a -list item. - -Here's one with a bullet. -* criminey. diff --git a/tests/markdown-test/horizontal-rules.html b/tests/markdown-test/horizontal-rules.html deleted file mode 100644 index 478e8c5..0000000 --- a/tests/markdown-test/horizontal-rules.html +++ /dev/null @@ -1,39 +0,0 @@ -

Dashes:

-
-
-
-
-
---
-
-
-
-
-
-
- - -
-
-

Asterisks:

-
-
-
-
-
***
-
-
-
-
-
-
* * *
-
-

Underscores:

-
-
-
-
-
___
-
-
-
-
-
-
_ _ _
-
\ No newline at end of file diff --git a/tests/markdown-test/horizontal-rules.txt b/tests/markdown-test/horizontal-rules.txt deleted file mode 100644 index 1594bda..0000000 --- a/tests/markdown-test/horizontal-rules.txt +++ /dev/null @@ -1,67 +0,0 @@ -Dashes: - ---- - - --- - - --- - - --- - - --- - -- - - - - - - - - - - - - - - - - - - - - - - - - -Asterisks: - -*** - - *** - - *** - - *** - - *** - -* * * - - * * * - - * * * - - * * * - - * * * - - -Underscores: - -___ - - ___ - - ___ - - ___ - - ___ - -_ _ _ - - _ _ _ - - _ _ _ - - _ _ _ - - _ _ _ diff --git a/tests/markdown-test/inline-html-advanced.html b/tests/markdown-test/inline-html-advanced.html deleted file mode 100644 index af1dec1..0000000 --- a/tests/markdown-test/inline-html-advanced.html +++ /dev/null @@ -1,12 +0,0 @@ -

Simple block on one line:

-
foo
- -

And nested without indentation:

-
-
-
-foo -
-
-
bar
-
\ No newline at end of file diff --git a/tests/markdown-test/inline-html-advanced.txt b/tests/markdown-test/inline-html-advanced.txt deleted file mode 100644 index 9d71ddc..0000000 --- a/tests/markdown-test/inline-html-advanced.txt +++ /dev/null @@ -1,14 +0,0 @@ -Simple block on one line: - -
foo
- -And nested without indentation: - -
-
-
-foo -
-
-
bar
-
diff --git a/tests/markdown-test/inline-html-comments.html b/tests/markdown-test/inline-html-comments.html deleted file mode 100644 index 0d4cad9..0000000 --- a/tests/markdown-test/inline-html-comments.html +++ /dev/null @@ -1,11 +0,0 @@ -

Paragraph one.

- - - - -

Paragraph two.

- - -

The end.

\ No newline at end of file diff --git a/tests/markdown-test/inline-html-comments.txt b/tests/markdown-test/inline-html-comments.txt deleted file mode 100644 index 41d830d..0000000 --- a/tests/markdown-test/inline-html-comments.txt +++ /dev/null @@ -1,13 +0,0 @@ -Paragraph one. - - - - - -Paragraph two. - - - -The end. diff --git a/tests/markdown-test/inline-html-simple.html b/tests/markdown-test/inline-html-simple.html deleted file mode 100644 index cb10451..0000000 --- a/tests/markdown-test/inline-html-simple.html +++ /dev/null @@ -1,58 +0,0 @@ -

Here's a simple block:

-
- foo -
- -

This should be a code block, though:

-
<div>
-    foo
-</div>
-
-

As should this:

-
<div>foo</div>
-
-

Now, nested:

-
-
-
- foo -
-
-
- -

This should just be an HTML comment:

- - -

Multiline:

- - -

Code block:

-
<!-- Comment -->
-
-

Just plain comment, with trailing spaces on the line:

- - -

Code:

-
<hr />
-
-

Hr's:

-
- -
- -
- -
- -
- -
- -
- -
- -
\ No newline at end of file diff --git a/tests/markdown-test/inline-html-simple.txt b/tests/markdown-test/inline-html-simple.txt deleted file mode 100644 index 14aa2dc..0000000 --- a/tests/markdown-test/inline-html-simple.txt +++ /dev/null @@ -1,69 +0,0 @@ -Here's a simple block: - -
- foo -
- -This should be a code block, though: - -
- foo -
- -As should this: - -
foo
- -Now, nested: - -
-
-
- foo -
-
-
- -This should just be an HTML comment: - - - -Multiline: - - - -Code block: - - - -Just plain comment, with trailing spaces on the line: - - - -Code: - -
- -Hr's: - -
- -
- -
- -
- -
- -
- -
- -
- -
- diff --git a/tests/markdown-test/links-inline.html b/tests/markdown-test/links-inline.html deleted file mode 100644 index 707937a..0000000 --- a/tests/markdown-test/links-inline.html +++ /dev/null @@ -1,5 +0,0 @@ -

Just a URL.

-

URL and title.

-

URL and title.

-

URL and title.

-

Empty.

\ No newline at end of file diff --git a/tests/markdown-test/links-inline.txt b/tests/markdown-test/links-inline.txt deleted file mode 100644 index 4d0c1c2..0000000 --- a/tests/markdown-test/links-inline.txt +++ /dev/null @@ -1,9 +0,0 @@ -Just a [URL](/url/). - -[URL and title](/url/ "title"). - -[URL and title](/url/ "title preceded by two spaces"). - -[URL and title](/url/ "title preceded by a tab"). - -[Empty](). diff --git a/tests/markdown-test/links-reference.html b/tests/markdown-test/links-reference.html deleted file mode 100644 index 165c71a..0000000 --- a/tests/markdown-test/links-reference.html +++ /dev/null @@ -1,10 +0,0 @@ -

Foo bar.

-

Foo bar.

-

Foo bar.

-

With embedded [brackets].

-

Indented once.

-

Indented twice.

-

Indented thrice.

-

Indented [four][] times.

-
[four]: /url
-
\ No newline at end of file diff --git a/tests/markdown-test/links-reference.txt b/tests/markdown-test/links-reference.txt deleted file mode 100644 index b2fa734..0000000 --- a/tests/markdown-test/links-reference.txt +++ /dev/null @@ -1,31 +0,0 @@ -Foo [bar] [1]. - -Foo [bar][1]. - -Foo [bar] -[1]. - -[1]: /url/ "Title" - - -With [embedded [brackets]] [b]. - - -Indented [once][]. - -Indented [twice][]. - -Indented [thrice][]. - -Indented [four][] times. - - [once]: /url - - [twice]: /url - - [thrice]: /url - - [four]: /url - - -[b]: /url/ diff --git a/tests/markdown-test/literal-quotes.html b/tests/markdown-test/literal-quotes.html deleted file mode 100644 index 0342589..0000000 --- a/tests/markdown-test/literal-quotes.html +++ /dev/null @@ -1,2 +0,0 @@ -

Foo bar.

-

Foo bar.

\ No newline at end of file diff --git a/tests/markdown-test/literal-quotes.txt b/tests/markdown-test/literal-quotes.txt deleted file mode 100644 index 29d0e42..0000000 --- a/tests/markdown-test/literal-quotes.txt +++ /dev/null @@ -1,7 +0,0 @@ -Foo [bar][]. - -Foo [bar](/url/ "Title with "quotes" inside"). - - - [bar]: /url/ "Title with "quotes" inside" - diff --git a/tests/markdown-test/markdown-documentation-basics.html b/tests/markdown-test/markdown-documentation-basics.html deleted file mode 100644 index 3bcaea9..0000000 --- a/tests/markdown-test/markdown-documentation-basics.html +++ /dev/null @@ -1,243 +0,0 @@ -

Markdown: Basics

- - -

Getting the Gist of Markdown's Formatting Syntax

-

This page offers a brief overview of what it's like to use Markdown. -The syntax page provides complete, detailed documentation for -every feature, but Markdown should be very easy to pick up simply by -looking at a few examples of it in action. The examples on this page -are written in a before/after style, showing example syntax and the -HTML output produced by Markdown.

-

It's also helpful to simply try Markdown out; the Dingus is a -web application that allows you type your own Markdown-formatted text -and translate it to XHTML.

-

Note: This document is itself written using Markdown; you -can see the source for it by adding '.text' to the URL.

-

Paragraphs, Headers, Blockquotes

-

A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs.

-

Markdown offers two styles of headers: Setext and atx. -Setext-style headers for <h1> and <h2> are created by -"underlining" with equal signs (=) and hyphens (-), respectively. -To create an atx-style header, you put 1-6 hash marks (#) at the -beginning of the line -- the number of hashes equals the resulting -HTML header level.

-

Blockquotes are indicated using email-style '>' angle brackets.

-

Markdown:

-
A First Level Header
-====================
-
-A Second Level Header
----------------------
-
-Now is the time for all good men to come to
-the aid of their country. This is just a
-regular paragraph.
-
-The quick brown fox jumped over the lazy
-dog's back.
-
-### Header 3
-
-> This is a blockquote.
-> 
-> This is the second paragraph in the blockquote.
->
-> ## This is an H2 in a blockquote
-
-

Output:

-
<h1>A First Level Header</h1>
-
-<h2>A Second Level Header</h2>
-
-<p>Now is the time for all good men to come to
-the aid of their country. This is just a
-regular paragraph.</p>
-
-<p>The quick brown fox jumped over the lazy
-dog's back.</p>
-
-<h3>Header 3</h3>
-
-<blockquote>
-    <p>This is a blockquote.</p>
-
-    <p>This is the second paragraph in the blockquote.</p>
-
-    <h2>This is an H2 in a blockquote</h2>
-</blockquote>
-
-

Phrase Emphasis

-

Markdown uses asterisks and underscores to indicate spans of emphasis.

-

Markdown:

-
Some of these words *are emphasized*.
-Some of these words _are emphasized also_.
-
-Use two asterisks for **strong emphasis**.
-Or, if you prefer, __use two underscores instead__.
-
-

Output:

-
<p>Some of these words <em>are emphasized</em>.
-Some of these words <em>are emphasized also</em>.</p>
-
-<p>Use two asterisks for <strong>strong emphasis</strong>.
-Or, if you prefer, <strong>use two underscores instead</strong>.</p>
-
-

Lists

-

Unordered (bulleted) lists use asterisks, pluses, and hyphens (*, -+, and -) as list markers. These three markers are -interchangable; this:

-
*   Candy.
-*   Gum.
-*   Booze.
-
-

this:

-
+   Candy.
-+   Gum.
-+   Booze.
-
-

and this:

-
-   Candy.
--   Gum.
--   Booze.
-
-

all produce the same output:

-
<ul>
-<li>Candy.</li>
-<li>Gum.</li>
-<li>Booze.</li>
-</ul>
-
-

Ordered (numbered) lists use regular numbers, followed by periods, as -list markers:

-
1.  Red
-2.  Green
-3.  Blue
-
-

Output:

-
<ol>
-<li>Red</li>
-<li>Green</li>
-<li>Blue</li>
-</ol>
-
-

If you put blank lines between items, you'll get <p> tags for the -list item text. You can create multi-paragraph list items by indenting -the paragraphs by 4 spaces or 1 tab:

-
*   A list item.
-
-    With multiple paragraphs.
-
-*   Another item in the list.
-
-

Output:

-
<ul>
-<li><p>A list item.</p>
-<p>With multiple paragraphs.</p></li>
-<li><p>Another item in the list.</p></li>
-</ul>
-
-

Links

-

Markdown supports two styles for creating links: inline and -reference. With both styles, you use square brackets to delimit the -text you want to turn into a link.

-

Inline-style links use parentheses immediately after the link text. -For example:

-
This is an [example link](http://example.com/).
-
-

Output:

-
<p>This is an <a href="http://example.com/">
-example link</a>.</p>
-
-

Optionally, you may include a title attribute in the parentheses:

-
This is an [example link](http://example.com/ "With a Title").
-
-

Output:

-
<p>This is an <a href="http://example.com/" title="With a Title">
-example link</a>.</p>
-
-

Reference-style links allow you to refer to your links by names, which -you define elsewhere in your document:

-
I get 10 times more traffic from [Google][1] than from
-[Yahoo][2] or [MSN][3].
-
-[1]: http://google.com/        "Google"
-[2]: http://search.yahoo.com/  "Yahoo Search"
-[3]: http://search.msn.com/    "MSN Search"
-
-

Output:

-
<p>I get 10 times more traffic from <a href="http://google.com/"
-title="Google">Google</a> than from <a href="http://search.yahoo.com/"
-title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"
-title="MSN Search">MSN</a>.</p>
-
-

The title attribute is optional. Link names may contain letters, -numbers and spaces, but are not case sensitive:

-
I start my morning with a cup of coffee and
-[The New York Times][NY Times].
-
-[ny times]: http://www.nytimes.com/
-
-

Output:

-
<p>I start my morning with a cup of coffee and
-<a href="http://www.nytimes.com/">The New York Times</a>.</p>
-
-

Images

-

Image syntax is very much like link syntax.

-

Inline (titles are optional):

-
![alt text](/path/to/img.jpg "Title")
-
-

Reference-style:

-
![alt text][id]
-
-[id]: /path/to/img.jpg "Title"
-
-

Both of the above examples produce the same output:

-
<img src="/path/to/img.jpg" alt="alt text" title="Title" />
-
-

Code

-

In a regular paragraph, you can create code span by wrapping text in -backtick quotes. Any ampersands (&) and angle brackets (< or ->) will automatically be translated into HTML entities. This makes -it easy to use Markdown to write about HTML example code:

-
I strongly recommend against using any `<blink>` tags.
-
-I wish SmartyPants used named entities like `&mdash;`
-instead of decimal-encoded entites like `&#8212;`.
-
-

Output:

-
<p>I strongly recommend against using any
-<code>&lt;blink&gt;</code> tags.</p>
-
-<p>I wish SmartyPants used named entities like
-<code>&amp;mdash;</code> instead of decimal-encoded
-entites like <code>&amp;#8212;</code>.</p>
-
-

To specify an entire block of pre-formatted code, indent every line of -the block by 4 spaces or 1 tab. Just like with code spans, &, <, -and > characters will be escaped automatically.

-

Markdown:

-
If you want your page to validate under XHTML 1.0 Strict,
-you've got to put paragraph tags in your blockquotes:
-
-    <blockquote>
-        <p>For example.</p>
-    </blockquote>
-
-

Output:

-
<p>If you want your page to validate under XHTML 1.0 Strict,
-you've got to put paragraph tags in your blockquotes:</p>
-
-<pre><code>&lt;blockquote&gt;
-    &lt;p&gt;For example.&lt;/p&gt;
-&lt;/blockquote&gt;
-</code></pre>
-
\ No newline at end of file diff --git a/tests/markdown-test/markdown-documentation-basics.txt b/tests/markdown-test/markdown-documentation-basics.txt deleted file mode 100644 index 486055c..0000000 --- a/tests/markdown-test/markdown-documentation-basics.txt +++ /dev/null @@ -1,306 +0,0 @@ -Markdown: Basics -================ - - - - -Getting the Gist of Markdown's Formatting Syntax ------------------------------------------------- - -This page offers a brief overview of what it's like to use Markdown. -The [syntax page] [s] provides complete, detailed documentation for -every feature, but Markdown should be very easy to pick up simply by -looking at a few examples of it in action. The examples on this page -are written in a before/after style, showing example syntax and the -HTML output produced by Markdown. - -It's also helpful to simply try Markdown out; the [Dingus] [d] is a -web application that allows you type your own Markdown-formatted text -and translate it to XHTML. - -**Note:** This document is itself written using Markdown; you -can [see the source for it by adding '.text' to the URL] [src]. - - [s]: /projects/markdown/syntax "Markdown Syntax" - [d]: /projects/markdown/dingus "Markdown Dingus" - [src]: /projects/markdown/basics.text - - -## Paragraphs, Headers, Blockquotes ## - -A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs. - -Markdown offers two styles of headers: *Setext* and *atx*. -Setext-style headers for `

` and `

` are created by -"underlining" with equal signs (`=`) and hyphens (`-`), respectively. -To create an atx-style header, you put 1-6 hash marks (`#`) at the -beginning of the line -- the number of hashes equals the resulting -HTML header level. - -Blockquotes are indicated using email-style '`>`' angle brackets. - -Markdown: - - A First Level Header - ==================== - - A Second Level Header - --------------------- - - Now is the time for all good men to come to - the aid of their country. This is just a - regular paragraph. - - The quick brown fox jumped over the lazy - dog's back. - - ### Header 3 - - > This is a blockquote. - > - > This is the second paragraph in the blockquote. - > - > ## This is an H2 in a blockquote - - -Output: - -

A First Level Header

- -

A Second Level Header

- -

Now is the time for all good men to come to - the aid of their country. This is just a - regular paragraph.

- -

The quick brown fox jumped over the lazy - dog's back.

- -

Header 3

- -
-

This is a blockquote.

- -

This is the second paragraph in the blockquote.

- -

This is an H2 in a blockquote

-
- - - -### Phrase Emphasis ### - -Markdown uses asterisks and underscores to indicate spans of emphasis. - -Markdown: - - Some of these words *are emphasized*. - Some of these words _are emphasized also_. - - Use two asterisks for **strong emphasis**. - Or, if you prefer, __use two underscores instead__. - -Output: - -

Some of these words are emphasized. - Some of these words are emphasized also.

- -

Use two asterisks for strong emphasis. - Or, if you prefer, use two underscores instead.

- - - -## Lists ## - -Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`, -`+`, and `-`) as list markers. These three markers are -interchangable; this: - - * Candy. - * Gum. - * Booze. - -this: - - + Candy. - + Gum. - + Booze. - -and this: - - - Candy. - - Gum. - - Booze. - -all produce the same output: - -
    -
  • Candy.
  • -
  • Gum.
  • -
  • Booze.
  • -
- -Ordered (numbered) lists use regular numbers, followed by periods, as -list markers: - - 1. Red - 2. Green - 3. Blue - -Output: - -
    -
  1. Red
  2. -
  3. Green
  4. -
  5. Blue
  6. -
- -If you put blank lines between items, you'll get `

` tags for the -list item text. You can create multi-paragraph list items by indenting -the paragraphs by 4 spaces or 1 tab: - - * A list item. - - With multiple paragraphs. - - * Another item in the list. - -Output: - -

    -
  • A list item.

    -

    With multiple paragraphs.

  • -
  • Another item in the list.

  • -
- - - -### Links ### - -Markdown supports two styles for creating links: *inline* and -*reference*. With both styles, you use square brackets to delimit the -text you want to turn into a link. - -Inline-style links use parentheses immediately after the link text. -For example: - - This is an [example link](http://example.com/). - -Output: - -

This is an - example link.

- -Optionally, you may include a title attribute in the parentheses: - - This is an [example link](http://example.com/ "With a Title"). - -Output: - -

This is an - example link.

- -Reference-style links allow you to refer to your links by names, which -you define elsewhere in your document: - - I get 10 times more traffic from [Google][1] than from - [Yahoo][2] or [MSN][3]. - - [1]: http://google.com/ "Google" - [2]: http://search.yahoo.com/ "Yahoo Search" - [3]: http://search.msn.com/ "MSN Search" - -Output: - -

I get 10 times more traffic from Google than from Yahoo or MSN.

- -The title attribute is optional. Link names may contain letters, -numbers and spaces, but are *not* case sensitive: - - I start my morning with a cup of coffee and - [The New York Times][NY Times]. - - [ny times]: http://www.nytimes.com/ - -Output: - -

I start my morning with a cup of coffee and - The New York Times.

- - -### Images ### - -Image syntax is very much like link syntax. - -Inline (titles are optional): - - ![alt text](/path/to/img.jpg "Title") - -Reference-style: - - ![alt text][id] - - [id]: /path/to/img.jpg "Title" - -Both of the above examples produce the same output: - - alt text - - - -### Code ### - -In a regular paragraph, you can create code span by wrapping text in -backtick quotes. Any ampersands (`&`) and angle brackets (`<` or -`>`) will automatically be translated into HTML entities. This makes -it easy to use Markdown to write about HTML example code: - - I strongly recommend against using any `` tags. - - I wish SmartyPants used named entities like `—` - instead of decimal-encoded entites like `—`. - -Output: - -

I strongly recommend against using any - <blink> tags.

- -

I wish SmartyPants used named entities like - &mdash; instead of decimal-encoded - entites like &#8212;.

- - -To specify an entire block of pre-formatted code, indent every line of -the block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`, -and `>` characters will be escaped automatically. - -Markdown: - - If you want your page to validate under XHTML 1.0 Strict, - you've got to put paragraph tags in your blockquotes: - -
-

For example.

-
- -Output: - -

If you want your page to validate under XHTML 1.0 Strict, - you've got to put paragraph tags in your blockquotes:

- -
<blockquote>
-        <p>For example.</p>
-    </blockquote>
-    
diff --git a/tests/markdown-test/markdown-syntax.html b/tests/markdown-test/markdown-syntax.html deleted file mode 100644 index 038c9d1..0000000 --- a/tests/markdown-test/markdown-syntax.html +++ /dev/null @@ -1,728 +0,0 @@ -

Markdown: Syntax

- - - -

Note: This document is itself written using Markdown; you -can see the source for it by adding '.text' to the URL.

-
-

Overview

- -

Philosophy

- -

Markdown is intended to be as easy-to-read and easy-to-write as is feasible.

-

Readability, however, is emphasized above all else. A Markdown-formatted -document should be publishable as-is, as plain text, without looking -like it's been marked up with tags or formatting instructions. While -Markdown's syntax has been influenced by several existing text-to-HTML -filters -- including Setext, atx, Textile, reStructuredText, -Grutatext, and EtText -- the single biggest source of -inspiration for Markdown's syntax is the format of plain text email.

-

To this end, Markdown's syntax is comprised entirely of punctuation -characters, which punctuation characters have been carefully chosen so -as to look like what they mean. E.g., asterisks around a word actually -look like *emphasis*. Markdown lists look like, well, lists. Even -blockquotes look like quoted passages of text, assuming you've ever -used email.

-

Inline HTML

- -

Markdown's syntax is intended for one purpose: to be used as a -format for writing for the web.

-

Markdown is not a replacement for HTML, or even close to it. Its -syntax is very small, corresponding only to a very small subset of -HTML tags. The idea is not to create a syntax that makes it easier -to insert HTML tags. In my opinion, HTML tags are already easy to -insert. The idea for Markdown is to make it easy to read, write, and -edit prose. HTML is a publishing format; Markdown is a writing -format. Thus, Markdown's formatting syntax only addresses issues that -can be conveyed in plain text.

-

For any markup that is not covered by Markdown's syntax, you simply -use HTML itself. There's no need to preface it or delimit it to -indicate that you're switching from Markdown to HTML; you just use -the tags.

-

The only restrictions are that block-level HTML elements -- e.g. <div>, -<table>, <pre>, <p>, etc. -- must be separated from surrounding -content by blank lines, and the start and end tags of the block should -not be indented with tabs or spaces. Markdown is smart enough not -to add extra (unwanted) <p> tags around HTML block-level tags.

-

For example, to add an HTML table to a Markdown article:

-
This is a regular paragraph.
-
-<table>
-    <tr>
-        <td>Foo</td>
-    </tr>
-</table>
-
-This is another regular paragraph.
-
-

Note that Markdown formatting syntax is not processed within block-level -HTML tags. E.g., you can't use Markdown-style *emphasis* inside an -HTML block.

-

Span-level HTML tags -- e.g. <span>, <cite>, or <del> -- can be -used anywhere in a Markdown paragraph, list item, or header. If you -want, you can even use HTML tags instead of Markdown formatting; e.g. if -you'd prefer to use HTML <a> or <img> tags instead of Markdown's -link or image syntax, go right ahead.

-

Unlike block-level HTML tags, Markdown syntax is processed within -span-level tags.

-

Automatic Escaping for Special Characters

- -

In HTML, there are two characters that demand special treatment: < -and &. Left angle brackets are used to start tags; ampersands are -used to denote HTML entities. If you want to use them as literal -characters, you must escape them as entities, e.g. &lt;, and -&amp;.

-

Ampersands in particular are bedeviling for web writers. If you want to -write about 'AT&T', you need to write 'AT&amp;T'. You even need to -escape ampersands within URLs. Thus, if you want to link to:

-
http://images.google.com/images?num=30&q=larry+bird
-
-

you need to encode the URL as:

-
http://images.google.com/images?num=30&amp;q=larry+bird
-
-

in your anchor tag href attribute. Needless to say, this is easy to -forget, and is probably the single most common source of HTML validation -errors in otherwise well-marked-up web sites.

-

Markdown allows you to use these characters naturally, taking care of -all the necessary escaping for you. If you use an ampersand as part of -an HTML entity, it remains unchanged; otherwise it will be translated -into &amp;.

-

So, if you want to include a copyright symbol in your article, you can write:

-
&copy;
-
-

and Markdown will leave it alone. But if you write:

-
AT&T
-
-

Markdown will translate it to:

-
AT&amp;T
-
-

Similarly, because Markdown supports inline HTML, if you use -angle brackets as delimiters for HTML tags, Markdown will treat them as -such. But if you write:

-
4 < 5
-
-

Markdown will translate it to:

-
4 &lt; 5
-
-

However, inside Markdown code spans and blocks, angle brackets and -ampersands are always encoded automatically. This makes it easy to use -Markdown to write about HTML code. (As opposed to raw HTML, which is a -terrible format for writing about HTML syntax, because every single < -and & in your example code needs to be escaped.)

-
-

Block Elements

- -

Paragraphs and Line Breaks

- -

A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing but spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs.

-

The implication of the "one or more consecutive lines of text" rule is -that Markdown supports "hard-wrapped" text paragraphs. This differs -significantly from most other text-to-HTML formatters (including Movable -Type's "Convert Line Breaks" option) which translate every line break -character in a paragraph into a <br /> tag.

-

When you do want to insert a <br /> break tag using Markdown, you -end a line with two or more spaces, then type return.

-

Yes, this takes a tad more effort to create a <br />, but a simplistic -"every line break is a <br />" rule wouldn't work for Markdown. -Markdown's email-style blockquoting and multi-paragraph list items -work best -- and look better -- when you format them with hard breaks.

- - -

Markdown supports two styles of headers, Setext and atx.

-

Setext-style headers are "underlined" using equal signs (for first-level -headers) and dashes (for second-level headers). For example:

-
This is an H1
-=============
-
-This is an H2
--------------
-
-

Any number of underlining ='s or -'s will work.

-

Atx-style headers use 1-6 hash characters at the start of the line, -corresponding to header levels 1-6. For example:

-
# This is an H1
-
-## This is an H2
-
-###### This is an H6
-
-

Optionally, you may "close" atx-style headers. This is purely -cosmetic -- you can use this if you think it looks better. The -closing hashes don't even need to match the number of hashes -used to open the header. (The number of opening hashes -determines the header level.) :

-
# This is an H1 #
-
-## This is an H2 ##
-
-### This is an H3 ######
-
-

Blockquotes

- -

Markdown uses email-style > characters for blockquoting. If you're -familiar with quoting passages of text in an email message, then you -know how to create a blockquote in Markdown. It looks best if you hard -wrap the text and put a > before every line:

-
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
-> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
-> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
-> 
-> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
-> id sem consectetuer libero luctus adipiscing.
-
-

Markdown allows you to be lazy and only put the > before the first -line of a hard-wrapped paragraph:

-
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
-consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
-Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
-
-> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
-id sem consectetuer libero luctus adipiscing.
-
-

Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by -adding additional levels of >:

-
> This is the first level of quoting.
->
-> > This is nested blockquote.
->
-> Back to the first level.
-
-

Blockquotes can contain other Markdown elements, including headers, lists, -and code blocks:

-
> ## This is a header.
-> 
-> 1.   This is the first list item.
-> 2.   This is the second list item.
-> 
-> Here's some example code:
-> 
->     return shell_exec("echo $input | $markdown_script");
-
-

Any decent text editor should make email-style quoting easy. For -example, with BBEdit, you can make a selection and choose Increase -Quote Level from the Text menu.

-

Lists

- -

Markdown supports ordered (numbered) and unordered (bulleted) lists.

-

Unordered lists use asterisks, pluses, and hyphens -- interchangably --- as list markers:

-
*   Red
-*   Green
-*   Blue
-
-

is equivalent to:

-
+   Red
-+   Green
-+   Blue
-
-

and:

-
-   Red
--   Green
--   Blue
-
-

Ordered lists use numbers followed by periods:

-
1.  Bird
-2.  McHale
-3.  Parish
-
-

It's important to note that the actual numbers you use to mark the -list have no effect on the HTML output Markdown produces. The HTML -Markdown produces from the above list is:

-
<ol>
-<li>Bird</li>
-<li>McHale</li>
-<li>Parish</li>
-</ol>
-
-

If you instead wrote the list in Markdown like this:

-
1.  Bird
-1.  McHale
-1.  Parish
-
-

or even:

-
3. Bird
-1. McHale
-8. Parish
-
-

you'd get the exact same HTML output. The point is, if you want to, -you can use ordinal numbers in your ordered Markdown lists, so that -the numbers in your source match the numbers in your published HTML. -But if you want to be lazy, you don't have to.

-

If you do use lazy list numbering, however, you should still start the -list with the number 1. At some point in the future, Markdown may support -starting ordered lists at an arbitrary number.

-

List markers typically start at the left margin, but may be indented by -up to three spaces. List markers must be followed by one or more spaces -or a tab.

-

To make lists look nice, you can wrap items with hanging indents:

-
*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
-    Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
-    viverra nec, fringilla in, laoreet vitae, risus.
-*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
-    Suspendisse id sem consectetuer libero luctus adipiscing.
-
-

But if you want to be lazy, you don't have to:

-
*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
-Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
-viverra nec, fringilla in, laoreet vitae, risus.
-*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
-Suspendisse id sem consectetuer libero luctus adipiscing.
-
-

If list items are separated by blank lines, Markdown will wrap the -items in <p> tags in the HTML output. For example, this input:

-
*   Bird
-*   Magic
-
-

will turn into:

-
<ul>
-<li>Bird</li>
-<li>Magic</li>
-</ul>
-
-

But this:

-
*   Bird
-
-*   Magic
-
-

will turn into:

-
<ul>
-<li><p>Bird</p></li>
-<li><p>Magic</p></li>
-</ul>
-
-

List items may consist of multiple paragraphs. Each subsequent -paragraph in a list item must be intended by either 4 spaces -or one tab:

-
1.  This is a list item with two paragraphs. Lorem ipsum dolor
-    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
-    mi posuere lectus.
-
-    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
-    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
-    sit amet velit.
-
-2.  Suspendisse id sem consectetuer libero luctus adipiscing.
-
-

It looks nice if you indent every line of the subsequent -paragraphs, but here again, Markdown will allow you to be -lazy:

-
*   This is a list item with two paragraphs.
-
-    This is the second paragraph in the list item. You're
-only required to indent the first line. Lorem ipsum dolor
-sit amet, consectetuer adipiscing elit.
-
-*   Another item in the same list.
-
-

To put a blockquote within a list item, the blockquote's > -delimiters need to be indented:

-
*   A list item with a blockquote:
-
-    > This is a blockquote
-    > inside a list item.
-
-

To put a code block within a list item, the code block needs -to be indented twice -- 8 spaces or two tabs:

-
*   A list item with a code block:
-
-        <code goes here>
-
-

It's worth noting that it's possible to trigger an ordered list by -accident, by writing something like this:

-
1986. What a great season.
-
-

In other words, a number-period-space sequence at the beginning of a -line. To avoid this, you can backslash-escape the period:

-
1986\. What a great season.
-
-

Code Blocks

- -

Pre-formatted code blocks are used for writing about programming or -markup source code. Rather than forming normal paragraphs, the lines -of a code block are interpreted literally. Markdown wraps a code block -in both <pre> and <code> tags.

-

To produce a code block in Markdown, simply indent every line of the -block by at least 4 spaces or 1 tab. For example, given this input:

-
This is a normal paragraph:
-
-    This is a code block.
-
-

Markdown will generate:

-
<p>This is a normal paragraph:</p>
-
-<pre><code>This is a code block.
-</code></pre>
-
-

One level of indentation -- 4 spaces or 1 tab -- is removed from each -line of the code block. For example, this:

-
Here is an example of AppleScript:
-
-    tell application "Foo"
-        beep
-    end tell
-
-

will turn into:

-
<p>Here is an example of AppleScript:</p>
-
-<pre><code>tell application "Foo"
-    beep
-end tell
-</code></pre>
-
-

A code block continues until it reaches a line that is not indented -(or the end of the article).

-

Within a code block, ampersands (&) and angle brackets (< and >) -are automatically converted into HTML entities. This makes it very -easy to include example HTML source code using Markdown -- just paste -it and indent it, and Markdown will handle the hassle of encoding the -ampersands and angle brackets. For example, this:

-
    <div class="footer">
-        &copy; 2004 Foo Corporation
-    </div>
-
-

will turn into:

-
<pre><code>&lt;div class="footer"&gt;
-    &amp;copy; 2004 Foo Corporation
-&lt;/div&gt;
-</code></pre>
-
-

Regular Markdown syntax is not processed within code blocks. E.g., -asterisks are just literal asterisks within a code block. This means -it's also easy to use Markdown to write about Markdown's own syntax.

-

Horizontal Rules

- -

You can produce a horizontal rule tag (<hr />) by placing three or -more hyphens, asterisks, or underscores on a line by themselves. If you -wish, you may use spaces between the hyphens or asterisks. Each of the -following lines will produce a horizontal rule:

-
* * *
-
-***
-
-*****
-
-- - -
-
----------------------------------------
-
-_ _ _
-
-
-

Span Elements

- - - -

Markdown supports two style of links: inline and reference.

-

In both styles, the link text is delimited by [square brackets].

-

To create an inline link, use a set of regular parentheses immediately -after the link text's closing square bracket. Inside the parentheses, -put the URL where you want the link to point, along with an optional -title for the link, surrounded in quotes. For example:

-
This is [an example](http://example.com/ "Title") inline link.
-
-[This link](http://example.net/) has no title attribute.
-
-

Will produce:

-
<p>This is <a href="http://example.com/" title="Title">
-an example</a> inline link.</p>
-
-<p><a href="http://example.net/">This link</a> has no
-title attribute.</p>
-
-

If you're referring to a local resource on the same server, you can -use relative paths:

-
See my [About](/about/) page for details.
-
-

Reference-style links use a second set of square brackets, inside -which you place a label of your choosing to identify the link:

-
This is [an example][id] reference-style link.
-
-

You can optionally use a space to separate the sets of brackets:

-
This is [an example] [id] reference-style link.
-
-

Then, anywhere in the document, you define your link label like this, -on a line by itself:

-
[id]: http://example.com/  "Optional Title Here"
-
-

That is:

-
    -
  • Square brackets containing the link identifier (optionally - indented from the left margin using up to three spaces);
  • -
  • followed by a colon;
  • -
  • followed by one or more spaces (or tabs);
  • -
  • followed by the URL for the link;
  • -
  • optionally followed by a title attribute for the link, enclosed - in double or single quotes.
  • -
-

The link URL may, optionally, be surrounded by angle brackets:

-
[id]: <http://example.com/>  "Optional Title Here"
-
-

You can put the title attribute on the next line and use extra spaces -or tabs for padding, which tends to look better with longer URLs:

-
[id]: http://example.com/longish/path/to/resource/here
-    "Optional Title Here"
-
-

Link definitions are only used for creating links during Markdown -processing, and are stripped from your document in the HTML output.

-

Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are not case sensitive. E.g. these two links:

-
[link text][a]
-[link text][A]
-
-

are equivalent.

-

The implicit link name shortcut allows you to omit the name of the -link, in which case the link text itself is used as the name. -Just use an empty set of square brackets -- e.g., to link the word -"Google" to the google.com web site, you could simply write:

-
[Google][]
-
-

And then define the link:

-
[Google]: http://google.com/
-
-

Because link names may contain spaces, this shortcut even works for -multiple words in the link text:

-
Visit [Daring Fireball][] for more information.
-
-

And then define the link:

-
[Daring Fireball]: http://daringfireball.net/
-
-

Link definitions can be placed anywhere in your Markdown document. I -tend to put them immediately after each paragraph in which they're -used, but if you want, you can put them all at the end of your -document, sort of like footnotes.

-

Here's an example of reference links in action:

-
I get 10 times more traffic from [Google] [1] than from
-[Yahoo] [2] or [MSN] [3].
-
-  [1]: http://google.com/        "Google"
-  [2]: http://search.yahoo.com/  "Yahoo Search"
-  [3]: http://search.msn.com/    "MSN Search"
-
-

Using the implicit link name shortcut, you could instead write:

-
I get 10 times more traffic from [Google][] than from
-[Yahoo][] or [MSN][].
-
-  [google]: http://google.com/        "Google"
-  [yahoo]:  http://search.yahoo.com/  "Yahoo Search"
-  [msn]:    http://search.msn.com/    "MSN Search"
-
-

Both of the above examples will produce the following HTML output:

-
<p>I get 10 times more traffic from <a href="http://google.com/"
-title="Google">Google</a> than from
-<a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
-or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
-
-

For comparison, here is the same paragraph written using -Markdown's inline link style:

-
I get 10 times more traffic from [Google](http://google.com/ "Google")
-than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
-[MSN](http://search.msn.com/ "MSN Search").
-
-

The point of reference-style links is not that they're easier to -write. The point is that with reference-style links, your document -source is vastly more readable. Compare the above examples: using -reference-style links, the paragraph itself is only 81 characters -long; with inline-style links, it's 176 characters; and as raw HTML, -it's 234 characters. In the raw HTML, there's more markup than there -is text.

-

With Markdown's reference-style links, a source document much more -closely resembles the final output, as rendered in a browser. By -allowing you to move the markup-related metadata out of the paragraph, -you can add links without interrupting the narrative flow of your -prose.

-

Emphasis

- -

Markdown treats asterisks (*) and underscores (_) as indicators of -emphasis. Text wrapped with one * or _ will be wrapped with an -HTML <em> tag; double *'s or _'s will be wrapped with an HTML -<strong> tag. E.g., this input:

-
*single asterisks*
-
-_single underscores_
-
-**double asterisks**
-
-__double underscores__
-
-

will produce:

-
<em>single asterisks</em>
-
-<em>single underscores</em>
-
-<strong>double asterisks</strong>
-
-<strong>double underscores</strong>
-
-

You can use whichever style you prefer; the lone restriction is that -the same character must be used to open and close an emphasis span.

-

Emphasis can be used in the middle of a word:

-
un*fucking*believable
-
-

But if you surround an * or _ with spaces, it'll be treated as a -literal asterisk or underscore.

-

To produce a literal asterisk or underscore at a position where it -would otherwise be used as an emphasis delimiter, you can backslash -escape it:

-
\*this text is surrounded by literal asterisks\*
-
-

Code

- -

To indicate a span of code, wrap it with backtick quotes (`). -Unlike a pre-formatted code block, a code span indicates code within a -normal paragraph. For example:

-
Use the `printf()` function.
-
-

will produce:

-
<p>Use the <code>printf()</code> function.</p>
-
-

To include a literal backtick character within a code span, you can use -multiple backticks as the opening and closing delimiters:

-
``There is a literal backtick (`) here.``
-
-

which will produce this:

-
<p><code>There is a literal backtick (`) here.</code></p>
-
-

The backtick delimiters surrounding a code span may include spaces -- -one after the opening, one before the closing. This allows you to place -literal backtick characters at the beginning or end of a code span:

-
A single backtick in a code span: `` ` ``
-
-A backtick-delimited string in a code span: `` `foo` ``
-
-

will produce:

-
<p>A single backtick in a code span: <code>`</code></p>
-
-<p>A backtick-delimited string in a code span: <code>`foo`</code></p>
-
-

With a code span, ampersands and angle brackets are encoded as HTML -entities automatically, which makes it easy to include example HTML -tags. Markdown will turn this:

-
Please don't use any `<blink>` tags.
-
-

into:

-
<p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
-
-

You can write this:

-
`&#8212;` is the decimal-encoded equivalent of `&mdash;`.
-
-

to produce:

-
<p><code>&amp;#8212;</code> is the decimal-encoded
-equivalent of <code>&amp;mdash;</code>.</p>
-
-

Images

- -

Admittedly, it's fairly difficult to devise a "natural" syntax for -placing images into a plain text document format.

-

Markdown uses an image syntax that is intended to resemble the syntax -for links, allowing for two styles: inline and reference.

-

Inline image syntax looks like this:

-
![Alt text](/path/to/img.jpg)
-
-![Alt text](/path/to/img.jpg "Optional title")
-
-

That is:

-
    -
  • An exclamation mark: !;
  • -
  • followed by a set of square brackets, containing the alt - attribute text for the image;
  • -
  • followed by a set of parentheses, containing the URL or path to - the image, and an optional title attribute enclosed in double - or single quotes.
  • -
-

Reference-style image syntax looks like this:

-
![Alt text][id]
-
-

Where "id" is the name of a defined image reference. Image references -are defined using syntax identical to link references:

-
[id]: url/to/image  "Optional title attribute"
-
-

As of this writing, Markdown has no syntax for specifying the -dimensions of an image; if this is important to you, you can simply -use regular HTML <img> tags.

-
-

Miscellaneous

- - - -

Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:

-
<http://example.com/>
-
-

Markdown will turn this into:

-
<a href="http://example.com/">http://example.com/</a>
-
-

Automatic links for email addresses work similarly, except that -Markdown will also perform a bit of randomized decimal and hex -entity-encoding to help obscure your address from address-harvesting -spambots. For example, Markdown will turn this:

-
<address@example.com>
-
-

into something like this:

-
<a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65;
-&#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;
-&#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61;
-&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a>
-
-

which will render in a browser as a clickable link to "address@example.com".

-

(This sort of entity-encoding trick will indeed fool many, if not -most, address-harvesting bots, but it definitely won't fool all of -them. It's better than nothing, but an address published in this way -will probably eventually start receiving spam.)

-

Backslash Escapes

- -

Markdown allows you to use backslash escapes to generate literal -characters which would otherwise have special meaning in Markdown's -formatting syntax. For example, if you wanted to surround a word with -literal asterisks (instead of an HTML <em> tag), you can backslashes -before the asterisks, like this:

-
\*literal asterisks\*
-
-

Markdown provides backslash escapes for the following characters:

-
\   backslash
-`   backtick
-*   asterisk
-_   underscore
-{}  curly braces
-[]  square brackets
-()  parentheses
-#   hash mark
-+   plus sign
--   minus sign (hyphen)
-.   dot
-!   exclamation mark
-
\ No newline at end of file diff --git a/tests/markdown-test/markdown-syntax.txt b/tests/markdown-test/markdown-syntax.txt deleted file mode 100644 index dabd75c..0000000 --- a/tests/markdown-test/markdown-syntax.txt +++ /dev/null @@ -1,888 +0,0 @@ -Markdown: Syntax -================ - - - - -* [Overview](#overview) - * [Philosophy](#philosophy) - * [Inline HTML](#html) - * [Automatic Escaping for Special Characters](#autoescape) -* [Block Elements](#block) - * [Paragraphs and Line Breaks](#p) - * [Headers](#header) - * [Blockquotes](#blockquote) - * [Lists](#list) - * [Code Blocks](#precode) - * [Horizontal Rules](#hr) -* [Span Elements](#span) - * [Links](#link) - * [Emphasis](#em) - * [Code](#code) - * [Images](#img) -* [Miscellaneous](#misc) - * [Backslash Escapes](#backslash) - * [Automatic Links](#autolink) - - -**Note:** This document is itself written using Markdown; you -can [see the source for it by adding '.text' to the URL][src]. - - [src]: /projects/markdown/syntax.text - -* * * - -

Overview

- -

Philosophy

- -Markdown is intended to be as easy-to-read and easy-to-write as is feasible. - -Readability, however, is emphasized above all else. A Markdown-formatted -document should be publishable as-is, as plain text, without looking -like it's been marked up with tags or formatting instructions. While -Markdown's syntax has been influenced by several existing text-to-HTML -filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4], -[Grutatext] [5], and [EtText] [6] -- the single biggest source of -inspiration for Markdown's syntax is the format of plain text email. - - [1]: http://docutils.sourceforge.net/mirror/setext.html - [2]: http://www.aaronsw.com/2002/atx/ - [3]: http://textism.com/tools/textile/ - [4]: http://docutils.sourceforge.net/rst.html - [5]: http://www.triptico.com/software/grutatxt.html - [6]: http://ettext.taint.org/doc/ - -To this end, Markdown's syntax is comprised entirely of punctuation -characters, which punctuation characters have been carefully chosen so -as to look like what they mean. E.g., asterisks around a word actually -look like \*emphasis\*. Markdown lists look like, well, lists. Even -blockquotes look like quoted passages of text, assuming you've ever -used email. - - - -

Inline HTML

- -Markdown's syntax is intended for one purpose: to be used as a -format for *writing* for the web. - -Markdown is not a replacement for HTML, or even close to it. Its -syntax is very small, corresponding only to a very small subset of -HTML tags. The idea is *not* to create a syntax that makes it easier -to insert HTML tags. In my opinion, HTML tags are already easy to -insert. The idea for Markdown is to make it easy to read, write, and -edit prose. HTML is a *publishing* format; Markdown is a *writing* -format. Thus, Markdown's formatting syntax only addresses issues that -can be conveyed in plain text. - -For any markup that is not covered by Markdown's syntax, you simply -use HTML itself. There's no need to preface it or delimit it to -indicate that you're switching from Markdown to HTML; you just use -the tags. - -The only restrictions are that block-level HTML elements -- e.g. `
`, -``, `
`, `

`, etc. -- must be separated from surrounding -content by blank lines, and the start and end tags of the block should -not be indented with tabs or spaces. Markdown is smart enough not -to add extra (unwanted) `

` tags around HTML block-level tags. - -For example, to add an HTML table to a Markdown article: - - This is a regular paragraph. - -

- - - -
Foo
- - This is another regular paragraph. - -Note that Markdown formatting syntax is not processed within block-level -HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an -HTML block. - -Span-level HTML tags -- e.g. ``, ``, or `` -- can be -used anywhere in a Markdown paragraph, list item, or header. If you -want, you can even use HTML tags instead of Markdown formatting; e.g. if -you'd prefer to use HTML `` or `` tags instead of Markdown's -link or image syntax, go right ahead. - -Unlike block-level HTML tags, Markdown syntax *is* processed within -span-level tags. - - -

Automatic Escaping for Special Characters

- -In HTML, there are two characters that demand special treatment: `<` -and `&`. Left angle brackets are used to start tags; ampersands are -used to denote HTML entities. If you want to use them as literal -characters, you must escape them as entities, e.g. `<`, and -`&`. - -Ampersands in particular are bedeviling for web writers. If you want to -write about 'AT&T', you need to write '`AT&T`'. You even need to -escape ampersands within URLs. Thus, if you want to link to: - - http://images.google.com/images?num=30&q=larry+bird - -you need to encode the URL as: - - http://images.google.com/images?num=30&q=larry+bird - -in your anchor tag `href` attribute. Needless to say, this is easy to -forget, and is probably the single most common source of HTML validation -errors in otherwise well-marked-up web sites. - -Markdown allows you to use these characters naturally, taking care of -all the necessary escaping for you. If you use an ampersand as part of -an HTML entity, it remains unchanged; otherwise it will be translated -into `&`. - -So, if you want to include a copyright symbol in your article, you can write: - - © - -and Markdown will leave it alone. But if you write: - - AT&T - -Markdown will translate it to: - - AT&T - -Similarly, because Markdown supports [inline HTML](#html), if you use -angle brackets as delimiters for HTML tags, Markdown will treat them as -such. But if you write: - - 4 < 5 - -Markdown will translate it to: - - 4 < 5 - -However, inside Markdown code spans and blocks, angle brackets and -ampersands are *always* encoded automatically. This makes it easy to use -Markdown to write about HTML code. (As opposed to raw HTML, which is a -terrible format for writing about HTML syntax, because every single `<` -and `&` in your example code needs to be escaped.) - - -* * * - - -

Block Elements

- - -

Paragraphs and Line Breaks

- -A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing but spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs. - -The implication of the "one or more consecutive lines of text" rule is -that Markdown supports "hard-wrapped" text paragraphs. This differs -significantly from most other text-to-HTML formatters (including Movable -Type's "Convert Line Breaks" option) which translate every line break -character in a paragraph into a `
` tag. - -When you *do* want to insert a `
` break tag using Markdown, you -end a line with two or more spaces, then type return. - -Yes, this takes a tad more effort to create a `
`, but a simplistic -"every line break is a `
`" rule wouldn't work for Markdown. -Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l] -work best -- and look better -- when you format them with hard breaks. - - [bq]: #blockquote - [l]: #list - - - - - -Markdown supports two styles of headers, [Setext] [1] and [atx] [2]. - -Setext-style headers are "underlined" using equal signs (for first-level -headers) and dashes (for second-level headers). For example: - - This is an H1 - ============= - - This is an H2 - ------------- - -Any number of underlining `=`'s or `-`'s will work. - -Atx-style headers use 1-6 hash characters at the start of the line, -corresponding to header levels 1-6. For example: - - # This is an H1 - - ## This is an H2 - - ###### This is an H6 - -Optionally, you may "close" atx-style headers. This is purely -cosmetic -- you can use this if you think it looks better. The -closing hashes don't even need to match the number of hashes -used to open the header. (The number of opening hashes -determines the header level.) : - - # This is an H1 # - - ## This is an H2 ## - - ### This is an H3 ###### - - -

Blockquotes

- -Markdown uses email-style `>` characters for blockquoting. If you're -familiar with quoting passages of text in an email message, then you -know how to create a blockquote in Markdown. It looks best if you hard -wrap the text and put a `>` before every line: - - > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, - > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. - > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. - > - > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse - > id sem consectetuer libero luctus adipiscing. - -Markdown allows you to be lazy and only put the `>` before the first -line of a hard-wrapped paragraph: - - > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, - consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. - Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. - - > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse - id sem consectetuer libero luctus adipiscing. - -Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by -adding additional levels of `>`: - - > This is the first level of quoting. - > - > > This is nested blockquote. - > - > Back to the first level. - -Blockquotes can contain other Markdown elements, including headers, lists, -and code blocks: - - > ## This is a header. - > - > 1. This is the first list item. - > 2. This is the second list item. - > - > Here's some example code: - > - > return shell_exec("echo $input | $markdown_script"); - -Any decent text editor should make email-style quoting easy. For -example, with BBEdit, you can make a selection and choose Increase -Quote Level from the Text menu. - - -

Lists

- -Markdown supports ordered (numbered) and unordered (bulleted) lists. - -Unordered lists use asterisks, pluses, and hyphens -- interchangably --- as list markers: - - * Red - * Green - * Blue - -is equivalent to: - - + Red - + Green - + Blue - -and: - - - Red - - Green - - Blue - -Ordered lists use numbers followed by periods: - - 1. Bird - 2. McHale - 3. Parish - -It's important to note that the actual numbers you use to mark the -list have no effect on the HTML output Markdown produces. The HTML -Markdown produces from the above list is: - -
    -
  1. Bird
  2. -
  3. McHale
  4. -
  5. Parish
  6. -
- -If you instead wrote the list in Markdown like this: - - 1. Bird - 1. McHale - 1. Parish - -or even: - - 3. Bird - 1. McHale - 8. Parish - -you'd get the exact same HTML output. The point is, if you want to, -you can use ordinal numbers in your ordered Markdown lists, so that -the numbers in your source match the numbers in your published HTML. -But if you want to be lazy, you don't have to. - -If you do use lazy list numbering, however, you should still start the -list with the number 1. At some point in the future, Markdown may support -starting ordered lists at an arbitrary number. - -List markers typically start at the left margin, but may be indented by -up to three spaces. List markers must be followed by one or more spaces -or a tab. - -To make lists look nice, you can wrap items with hanging indents: - - * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. - Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, - viverra nec, fringilla in, laoreet vitae, risus. - * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. - Suspendisse id sem consectetuer libero luctus adipiscing. - -But if you want to be lazy, you don't have to: - - * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. - Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, - viverra nec, fringilla in, laoreet vitae, risus. - * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. - Suspendisse id sem consectetuer libero luctus adipiscing. - -If list items are separated by blank lines, Markdown will wrap the -items in `

` tags in the HTML output. For example, this input: - - * Bird - * Magic - -will turn into: - -

    -
  • Bird
  • -
  • Magic
  • -
- -But this: - - * Bird - - * Magic - -will turn into: - -
    -
  • Bird

  • -
  • Magic

  • -
- -List items may consist of multiple paragraphs. Each subsequent -paragraph in a list item must be intended by either 4 spaces -or one tab: - - 1. This is a list item with two paragraphs. Lorem ipsum dolor - sit amet, consectetuer adipiscing elit. Aliquam hendrerit - mi posuere lectus. - - Vestibulum enim wisi, viverra nec, fringilla in, laoreet - vitae, risus. Donec sit amet nisl. Aliquam semper ipsum - sit amet velit. - - 2. Suspendisse id sem consectetuer libero luctus adipiscing. - -It looks nice if you indent every line of the subsequent -paragraphs, but here again, Markdown will allow you to be -lazy: - - * This is a list item with two paragraphs. - - This is the second paragraph in the list item. You're - only required to indent the first line. Lorem ipsum dolor - sit amet, consectetuer adipiscing elit. - - * Another item in the same list. - -To put a blockquote within a list item, the blockquote's `>` -delimiters need to be indented: - - * A list item with a blockquote: - - > This is a blockquote - > inside a list item. - -To put a code block within a list item, the code block needs -to be indented *twice* -- 8 spaces or two tabs: - - * A list item with a code block: - - - - -It's worth noting that it's possible to trigger an ordered list by -accident, by writing something like this: - - 1986. What a great season. - -In other words, a *number-period-space* sequence at the beginning of a -line. To avoid this, you can backslash-escape the period: - - 1986\. What a great season. - - - -

Code Blocks

- -Pre-formatted code blocks are used for writing about programming or -markup source code. Rather than forming normal paragraphs, the lines -of a code block are interpreted literally. Markdown wraps a code block -in both `
` and `` tags.
-
-To produce a code block in Markdown, simply indent every line of the
-block by at least 4 spaces or 1 tab. For example, given this input:
-
-    This is a normal paragraph:
-
-        This is a code block.
-
-Markdown will generate:
-
-    

This is a normal paragraph:

- -
This is a code block.
-    
- -One level of indentation -- 4 spaces or 1 tab -- is removed from each -line of the code block. For example, this: - - Here is an example of AppleScript: - - tell application "Foo" - beep - end tell - -will turn into: - -

Here is an example of AppleScript:

- -
tell application "Foo"
-        beep
-    end tell
-    
- -A code block continues until it reaches a line that is not indented -(or the end of the article). - -Within a code block, ampersands (`&`) and angle brackets (`<` and `>`) -are automatically converted into HTML entities. This makes it very -easy to include example HTML source code using Markdown -- just paste -it and indent it, and Markdown will handle the hassle of encoding the -ampersands and angle brackets. For example, this: - - - -will turn into: - -
<div class="footer">
-        &copy; 2004 Foo Corporation
-    </div>
-    
- -Regular Markdown syntax is not processed within code blocks. E.g., -asterisks are just literal asterisks within a code block. This means -it's also easy to use Markdown to write about Markdown's own syntax. - - - -

Horizontal Rules

- -You can produce a horizontal rule tag (`
`) by placing three or -more hyphens, asterisks, or underscores on a line by themselves. If you -wish, you may use spaces between the hyphens or asterisks. Each of the -following lines will produce a horizontal rule: - - * * * - - *** - - ***** - - - - - - - --------------------------------------- - - _ _ _ - - -* * * - -

Span Elements

- - - -Markdown supports two style of links: *inline* and *reference*. - -In both styles, the link text is delimited by [square brackets]. - -To create an inline link, use a set of regular parentheses immediately -after the link text's closing square bracket. Inside the parentheses, -put the URL where you want the link to point, along with an *optional* -title for the link, surrounded in quotes. For example: - - This is [an example](http://example.com/ "Title") inline link. - - [This link](http://example.net/) has no title attribute. - -Will produce: - -

This is - an example inline link.

- -

This link has no - title attribute.

- -If you're referring to a local resource on the same server, you can -use relative paths: - - See my [About](/about/) page for details. - -Reference-style links use a second set of square brackets, inside -which you place a label of your choosing to identify the link: - - This is [an example][id] reference-style link. - -You can optionally use a space to separate the sets of brackets: - - This is [an example] [id] reference-style link. - -Then, anywhere in the document, you define your link label like this, -on a line by itself: - - [id]: http://example.com/ "Optional Title Here" - -That is: - -* Square brackets containing the link identifier (optionally - indented from the left margin using up to three spaces); -* followed by a colon; -* followed by one or more spaces (or tabs); -* followed by the URL for the link; -* optionally followed by a title attribute for the link, enclosed - in double or single quotes. - -The link URL may, optionally, be surrounded by angle brackets: - - [id]: "Optional Title Here" - -You can put the title attribute on the next line and use extra spaces -or tabs for padding, which tends to look better with longer URLs: - - [id]: http://example.com/longish/path/to/resource/here - "Optional Title Here" - -Link definitions are only used for creating links during Markdown -processing, and are stripped from your document in the HTML output. - -Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are *not* case sensitive. E.g. these two links: - - [link text][a] - [link text][A] - -are equivalent. - -The *implicit link name* shortcut allows you to omit the name of the -link, in which case the link text itself is used as the name. -Just use an empty set of square brackets -- e.g., to link the word -"Google" to the google.com web site, you could simply write: - - [Google][] - -And then define the link: - - [Google]: http://google.com/ - -Because link names may contain spaces, this shortcut even works for -multiple words in the link text: - - Visit [Daring Fireball][] for more information. - -And then define the link: - - [Daring Fireball]: http://daringfireball.net/ - -Link definitions can be placed anywhere in your Markdown document. I -tend to put them immediately after each paragraph in which they're -used, but if you want, you can put them all at the end of your -document, sort of like footnotes. - -Here's an example of reference links in action: - - I get 10 times more traffic from [Google] [1] than from - [Yahoo] [2] or [MSN] [3]. - - [1]: http://google.com/ "Google" - [2]: http://search.yahoo.com/ "Yahoo Search" - [3]: http://search.msn.com/ "MSN Search" - -Using the implicit link name shortcut, you could instead write: - - I get 10 times more traffic from [Google][] than from - [Yahoo][] or [MSN][]. - - [google]: http://google.com/ "Google" - [yahoo]: http://search.yahoo.com/ "Yahoo Search" - [msn]: http://search.msn.com/ "MSN Search" - -Both of the above examples will produce the following HTML output: - -

I get 10 times more traffic from Google than from - Yahoo - or MSN.

- -For comparison, here is the same paragraph written using -Markdown's inline link style: - - I get 10 times more traffic from [Google](http://google.com/ "Google") - than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or - [MSN](http://search.msn.com/ "MSN Search"). - -The point of reference-style links is not that they're easier to -write. The point is that with reference-style links, your document -source is vastly more readable. Compare the above examples: using -reference-style links, the paragraph itself is only 81 characters -long; with inline-style links, it's 176 characters; and as raw HTML, -it's 234 characters. In the raw HTML, there's more markup than there -is text. - -With Markdown's reference-style links, a source document much more -closely resembles the final output, as rendered in a browser. By -allowing you to move the markup-related metadata out of the paragraph, -you can add links without interrupting the narrative flow of your -prose. - - -

Emphasis

- -Markdown treats asterisks (`*`) and underscores (`_`) as indicators of -emphasis. Text wrapped with one `*` or `_` will be wrapped with an -HTML `` tag; double `*`'s or `_`'s will be wrapped with an HTML -`` tag. E.g., this input: - - *single asterisks* - - _single underscores_ - - **double asterisks** - - __double underscores__ - -will produce: - - single asterisks - - single underscores - - double asterisks - - double underscores - -You can use whichever style you prefer; the lone restriction is that -the same character must be used to open and close an emphasis span. - -Emphasis can be used in the middle of a word: - - un*fucking*believable - -But if you surround an `*` or `_` with spaces, it'll be treated as a -literal asterisk or underscore. - -To produce a literal asterisk or underscore at a position where it -would otherwise be used as an emphasis delimiter, you can backslash -escape it: - - \*this text is surrounded by literal asterisks\* - - - -

Code

- -To indicate a span of code, wrap it with backtick quotes (`` ` ``). -Unlike a pre-formatted code block, a code span indicates code within a -normal paragraph. For example: - - Use the `printf()` function. - -will produce: - -

Use the printf() function.

- -To include a literal backtick character within a code span, you can use -multiple backticks as the opening and closing delimiters: - - ``There is a literal backtick (`) here.`` - -which will produce this: - -

There is a literal backtick (`) here.

- -The backtick delimiters surrounding a code span may include spaces -- -one after the opening, one before the closing. This allows you to place -literal backtick characters at the beginning or end of a code span: - - A single backtick in a code span: `` ` `` - - A backtick-delimited string in a code span: `` `foo` `` - -will produce: - -

A single backtick in a code span: `

- -

A backtick-delimited string in a code span: `foo`

- -With a code span, ampersands and angle brackets are encoded as HTML -entities automatically, which makes it easy to include example HTML -tags. Markdown will turn this: - - Please don't use any `` tags. - -into: - -

Please don't use any <blink> tags.

- -You can write this: - - `—` is the decimal-encoded equivalent of `—`. - -to produce: - -

&#8212; is the decimal-encoded - equivalent of &mdash;.

- - - -

Images

- -Admittedly, it's fairly difficult to devise a "natural" syntax for -placing images into a plain text document format. - -Markdown uses an image syntax that is intended to resemble the syntax -for links, allowing for two styles: *inline* and *reference*. - -Inline image syntax looks like this: - - ![Alt text](/path/to/img.jpg) - - ![Alt text](/path/to/img.jpg "Optional title") - -That is: - -* An exclamation mark: `!`; -* followed by a set of square brackets, containing the `alt` - attribute text for the image; -* followed by a set of parentheses, containing the URL or path to - the image, and an optional `title` attribute enclosed in double - or single quotes. - -Reference-style image syntax looks like this: - - ![Alt text][id] - -Where "id" is the name of a defined image reference. Image references -are defined using syntax identical to link references: - - [id]: url/to/image "Optional title attribute" - -As of this writing, Markdown has no syntax for specifying the -dimensions of an image; if this is important to you, you can simply -use regular HTML `` tags. - - -* * * - - -

Miscellaneous

- - - -Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this: - - - -Markdown will turn this into: - - http://example.com/ - -Automatic links for email addresses work similarly, except that -Markdown will also perform a bit of randomized decimal and hex -entity-encoding to help obscure your address from address-harvesting -spambots. For example, Markdown will turn this: - - - -into something like this: - - address@exa - mple.com - -which will render in a browser as a clickable link to "address@example.com". - -(This sort of entity-encoding trick will indeed fool many, if not -most, address-harvesting bots, but it definitely won't fool all of -them. It's better than nothing, but an address published in this way -will probably eventually start receiving spam.) - - - -

Backslash Escapes

- -Markdown allows you to use backslash escapes to generate literal -characters which would otherwise have special meaning in Markdown's -formatting syntax. For example, if you wanted to surround a word with -literal asterisks (instead of an HTML `` tag), you can backslashes -before the asterisks, like this: - - \*literal asterisks\* - -Markdown provides backslash escapes for the following characters: - - \ backslash - ` backtick - * asterisk - _ underscore - {} curly braces - [] square brackets - () parentheses - # hash mark - + plus sign - - minus sign (hyphen) - . dot - ! exclamation mark - diff --git a/tests/markdown-test/nested-blockquotes.html b/tests/markdown-test/nested-blockquotes.html deleted file mode 100644 index f1b017e..0000000 --- a/tests/markdown-test/nested-blockquotes.html +++ /dev/null @@ -1,7 +0,0 @@ -
-

foo

-
-

bar

-
-

foo

-
\ No newline at end of file diff --git a/tests/markdown-test/nested-blockquotes.txt b/tests/markdown-test/nested-blockquotes.txt deleted file mode 100644 index ed3c624..0000000 --- a/tests/markdown-test/nested-blockquotes.txt +++ /dev/null @@ -1,5 +0,0 @@ -> foo -> -> > bar -> -> foo diff --git a/tests/markdown-test/ordered-and-unordered-list.html b/tests/markdown-test/ordered-and-unordered-list.html deleted file mode 100644 index 090c43c..0000000 --- a/tests/markdown-test/ordered-and-unordered-list.html +++ /dev/null @@ -1,146 +0,0 @@ -

Unordered

-

Asterisks tight:

-
    -
  • asterisk 1
  • -
  • asterisk 2
  • -
  • asterisk 3
  • -
-

Asterisks loose:

-
    -
  • -

    asterisk 1

    -
  • -
  • -

    asterisk 2

    -
  • -
  • -

    asterisk 3

    -
  • -
-
-

Pluses tight:

-
    -
  • Plus 1
  • -
  • Plus 2
  • -
  • Plus 3
  • -
-

Pluses loose:

-
    -
  • -

    Plus 1

    -
  • -
  • -

    Plus 2

    -
  • -
  • -

    Plus 3

    -
  • -
-
-

Minuses tight:

-
    -
  • Minus 1
  • -
  • Minus 2
  • -
  • Minus 3
  • -
-

Minuses loose:

-
    -
  • -

    Minus 1

    -
  • -
  • -

    Minus 2

    -
  • -
  • -

    Minus 3

    -
  • -
-

Ordered

-

Tight:

-
    -
  1. First
  2. -
  3. Second
  4. -
  5. Third
  6. -
-

and:

-
    -
  1. One
  2. -
  3. Two
  4. -
  5. Three
  6. -
-

Loose using tabs:

-
    -
  1. -

    First

    -
  2. -
  3. -

    Second

    -
  4. -
  5. -

    Third

    -
  6. -
-

and using spaces:

-
    -
  1. -

    One

    -
  2. -
  3. -

    Two

    -
  4. -
  5. -

    Three

    -
  6. -
-

Multiple paragraphs:

-
    -
  1. -

    Item 1, graf one.

    -

    Item 2. graf two. The quick brown fox jumped over the lazy dog's -back.

    -
  2. -
  3. -

    Item 2.

    -
  4. -
  5. -

    Item 3.

    -
  6. -
-

Nested

-
    -
  • Tab
      -
    • Tab
        -
      • Tab
      • -
      -
    • -
    -
  • -
-

Here's another:

-
    -
  1. First
  2. -
  3. Second:
      -
    • Fee
    • -
    • Fie
    • -
    • Foe
    • -
    -
  4. -
  5. Third
  6. -
-

Same thing but with paragraphs:

-
    -
  1. -

    First

    -
  2. -
  3. -

    Second:

    -
      -
    • Fee
    • -
    • Fie
    • -
    • Foe
    • -
    -
  4. -
  5. -

    Third

    -
  6. -
\ No newline at end of file diff --git a/tests/markdown-test/ordered-and-unordered-list.txt b/tests/markdown-test/ordered-and-unordered-list.txt deleted file mode 100644 index 621db58..0000000 --- a/tests/markdown-test/ordered-and-unordered-list.txt +++ /dev/null @@ -1,122 +0,0 @@ -## Unordered - -Asterisks tight: - -* asterisk 1 -* asterisk 2 -* asterisk 3 - - -Asterisks loose: - -* asterisk 1 - -* asterisk 2 - -* asterisk 3 - -* * * - -Pluses tight: - -+ Plus 1 -+ Plus 2 -+ Plus 3 - - -Pluses loose: - -+ Plus 1 - -+ Plus 2 - -+ Plus 3 - -* * * - - -Minuses tight: - -- Minus 1 -- Minus 2 -- Minus 3 - - -Minuses loose: - -- Minus 1 - -- Minus 2 - -- Minus 3 - - -## Ordered - -Tight: - -1. First -2. Second -3. Third - -and: - -1. One -2. Two -3. Three - - -Loose using tabs: - -1. First - -2. Second - -3. Third - -and using spaces: - -1. One - -2. Two - -3. Three - -Multiple paragraphs: - -1. Item 1, graf one. - - Item 2. graf two. The quick brown fox jumped over the lazy dog's - back. - -2. Item 2. - -3. Item 3. - - - -## Nested - -* Tab - * Tab - * Tab - -Here's another: - -1. First -2. Second: - * Fee - * Fie - * Foe -3. Third - -Same thing but with paragraphs: - -1. First - -2. Second: - * Fee - * Fie - * Foe - -3. Third diff --git a/tests/markdown-test/strong-and-em-together.html b/tests/markdown-test/strong-and-em-together.html deleted file mode 100644 index 7bf5163..0000000 --- a/tests/markdown-test/strong-and-em-together.html +++ /dev/null @@ -1,4 +0,0 @@ -

This is strong and em.

-

So is this word.

-

This is strong and em.

-

So is this word.

\ No newline at end of file diff --git a/tests/markdown-test/strong-and-em-together.txt b/tests/markdown-test/strong-and-em-together.txt deleted file mode 100644 index 95ee690..0000000 --- a/tests/markdown-test/strong-and-em-together.txt +++ /dev/null @@ -1,7 +0,0 @@ -***This is strong and em.*** - -So is ***this*** word. - -___This is strong and em.___ - -So is ___this___ word. diff --git a/tests/markdown-test/tabs.html b/tests/markdown-test/tabs.html deleted file mode 100644 index 3c11f14..0000000 --- a/tests/markdown-test/tabs.html +++ /dev/null @@ -1,23 +0,0 @@ -
    -
  • -

    this is a list item - indented with tabs

    -
  • -
  • -

    this is a list item - indented with spaces

    -
  • -
-

Code:

-
this code block is indented by one tab
-
-

And:

-
    this code block is indented by two tabs
-
-

And:

-
+   this is an example list item
-    indented with tabs
-
-+   this is an example list item
-    indented with spaces
-
\ No newline at end of file diff --git a/tests/markdown-test/tabs.txt b/tests/markdown-test/tabs.txt deleted file mode 100644 index 589d113..0000000 --- a/tests/markdown-test/tabs.txt +++ /dev/null @@ -1,21 +0,0 @@ -+ this is a list item - indented with tabs - -+ this is a list item - indented with spaces - -Code: - - this code block is indented by one tab - -And: - - this code block is indented by two tabs - -And: - - + this is an example list item - indented with tabs - - + this is an example list item - indented with spaces diff --git a/tests/markdown-test/tidyness.html b/tests/markdown-test/tidyness.html deleted file mode 100644 index 52b2eaf..0000000 --- a/tests/markdown-test/tidyness.html +++ /dev/null @@ -1,8 +0,0 @@ -
-

A list within a blockquote:

-
    -
  • asterisk 1
  • -
  • asterisk 2
  • -
  • asterisk 3
  • -
-
\ No newline at end of file diff --git a/tests/markdown-test/tidyness.txt b/tests/markdown-test/tidyness.txt deleted file mode 100644 index 5f18b8d..0000000 --- a/tests/markdown-test/tidyness.txt +++ /dev/null @@ -1,5 +0,0 @@ -> A list within a blockquote: -> -> * asterisk 1 -> * asterisk 2 -> * asterisk 3 diff --git a/tests/misc/CRLF_line_ends.html b/tests/misc/CRLF_line_ends.html deleted file mode 100644 index a72b1ca..0000000 --- a/tests/misc/CRLF_line_ends.html +++ /dev/null @@ -1,4 +0,0 @@ -

foo

-
-bar -
\ No newline at end of file diff --git a/tests/misc/CRLF_line_ends.txt b/tests/misc/CRLF_line_ends.txt deleted file mode 100644 index 7d5e324..0000000 --- a/tests/misc/CRLF_line_ends.txt +++ /dev/null @@ -1,5 +0,0 @@ -foo - -
-bar -
diff --git a/tests/misc/adjacent-headers.html b/tests/misc/adjacent-headers.html deleted file mode 100644 index bd171aa..0000000 --- a/tests/misc/adjacent-headers.html +++ /dev/null @@ -1,2 +0,0 @@ -

this is a huge header

-

this is a smaller header

\ No newline at end of file diff --git a/tests/misc/adjacent-headers.txt b/tests/misc/adjacent-headers.txt deleted file mode 100644 index 0e626b9..0000000 --- a/tests/misc/adjacent-headers.txt +++ /dev/null @@ -1,2 +0,0 @@ -# this is a huge header # -## this is a smaller header ## diff --git a/tests/misc/amp-in-url.html b/tests/misc/amp-in-url.html deleted file mode 100644 index 2170a54..0000000 --- a/tests/misc/amp-in-url.html +++ /dev/null @@ -1 +0,0 @@ -

link

\ No newline at end of file diff --git a/tests/misc/amp-in-url.txt b/tests/misc/amp-in-url.txt deleted file mode 100644 index 471106e..0000000 --- a/tests/misc/amp-in-url.txt +++ /dev/null @@ -1 +0,0 @@ -[link](http://www.freewisdom.org/this&that) diff --git a/tests/misc/ampersand.html b/tests/misc/ampersand.html deleted file mode 100644 index 94ed80c..0000000 --- a/tests/misc/ampersand.html +++ /dev/null @@ -1,2 +0,0 @@ -

&

-

AT&T

\ No newline at end of file diff --git a/tests/misc/ampersand.txt b/tests/misc/ampersand.txt deleted file mode 100644 index 367d32c..0000000 --- a/tests/misc/ampersand.txt +++ /dev/null @@ -1,5 +0,0 @@ -& - -AT&T - - diff --git a/tests/misc/arabic.html b/tests/misc/arabic.html deleted file mode 100644 index 55991de..0000000 --- a/tests/misc/arabic.html +++ /dev/null @@ -1,27 +0,0 @@ -

بايثون

-

بايثون لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (OOP) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوحة المصدر. صُنفت بالأساس كلغة تفسيرية ، بايثون مصممة أصلاً للأداء بعض المهام الخاصة أو المحدودة. إلا أنه يمكن استخدامها بايثون لإنجاز المشاريع الضخمه كأي لغة برمجية أخرى، غالباً ما يُنصح المبتدئين في ميدان البرمجة بتعلم هذه اللغة لأنها من بين أسهل اللغات البرمجية تعلماً.

-

نشأت بايثون في مركز CWI (مركز العلوم والحاسب الآلي) بأمستردام على يد جويدو فان رُزوم. تم تطويرها بلغة C. أطلق فان رُزوم اسم "بايثون" على لغته تعبيرًا عن إعجابه بفِرقَة مسرحية هزلية شهيرة من بريطانيا، كانت تطلق على نفسها اسم مونتي بايثون Monty Python.

-

تتميز بايثون بمجتمعها النشط ، كما أن لها الكثير من المكتبات البرمجية ذات الأغراض الخاصة والتي برمجها أشخاص من مجتمع هذه اللغة ، مثلاً مكتبة PyGame التي توفر مجموعه من الوظائف من اجل برمجة الالعاب. ويمكن لبايثون التعامل مع العديد من أنواع قواعد البيانات مثل MySQL وغيره.

-

أمثلة

-

مثال Hello World!

-
print "Hello World!"
-
-

مثال لاستخراج المضروب Factorial :

-
num = 1
-x = raw_input('Insert the number please ')
-x = int(x)
-
-if x > 69:
- print 'Math Error !'
-else:
- while x > 1:
-  num *= x
-  x = x-1
-
- print num
-
-

وصلات خارجية

- -

بذرة حاس

\ No newline at end of file diff --git a/tests/misc/arabic.txt b/tests/misc/arabic.txt deleted file mode 100644 index ba2fef4..0000000 --- a/tests/misc/arabic.txt +++ /dev/null @@ -1,37 +0,0 @@ - -بايثون -===== - -**بايثون** لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (OOP) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوحة المصدر. صُنفت بالأساس كلغة تفسيرية ، بايثون مصممة أصلاً للأداء بعض المهام الخاصة أو المحدودة. إلا أنه يمكن استخدامها بايثون لإنجاز المشاريع الضخمه كأي لغة برمجية أخرى، غالباً ما يُنصح المبتدئين في ميدان البرمجة بتعلم هذه اللغة لأنها من بين أسهل اللغات البرمجية تعلماً. - -نشأت بايثون في مركز CWI (مركز العلوم والحاسب الآلي) بأمستردام على يد جويدو فان رُزوم. تم تطويرها بلغة C. أطلق فان رُزوم اسم "بايثون" على لغته تعبيرًا عن إعجابه بفِرقَة مسرحية هزلية شهيرة من بريطانيا، كانت تطلق على نفسها اسم مونتي بايثون Monty Python. - -تتميز بايثون بمجتمعها النشط ، كما أن لها الكثير من المكتبات البرمجية ذات الأغراض الخاصة والتي برمجها أشخاص من مجتمع هذه اللغة ، مثلاً مكتبة PyGame التي توفر مجموعه من الوظائف من اجل برمجة الالعاب. ويمكن لبايثون التعامل مع العديد من أنواع قواعد البيانات مثل MySQL وغيره. - -##أمثلة -مثال Hello World! - - print "Hello World!" - - -مثال لاستخراج المضروب Factorial : - - num = 1 - x = raw_input('Insert the number please ') - x = int(x) - - if x > 69: - print 'Math Error !' - else: - while x > 1: - num *= x - x = x-1 - - print num - - - -##وصلات خارجية -* [الموقع الرسمي للغة بايثون](http://www.python.org) - - بذرة حاس diff --git a/tests/misc/attributes2.html b/tests/misc/attributes2.html deleted file mode 100644 index 5971cc8..0000000 --- a/tests/misc/attributes2.html +++ /dev/null @@ -1,6 +0,0 @@ -

-

    -
  • -
-

Or in the middle of the text

-

\ No newline at end of file diff --git a/tests/misc/attributes2.txt b/tests/misc/attributes2.txt deleted file mode 100644 index d635cb2..0000000 --- a/tests/misc/attributes2.txt +++ /dev/null @@ -1,10 +0,0 @@ -{@id=TABLE.OF.CONTENTS} - - -* {@id=TABLEOFCONTENTS} - - -Or in the middle of the text {@id=TABLEOFCONTENTS} - -{@id=tableofcontents} - diff --git a/tests/misc/autolinks_with_asterisks.html b/tests/misc/autolinks_with_asterisks.html deleted file mode 100644 index 7cb852f..0000000 --- a/tests/misc/autolinks_with_asterisks.html +++ /dev/null @@ -1 +0,0 @@ -

http://some.site/weird*url*thing

\ No newline at end of file diff --git a/tests/misc/autolinks_with_asterisks.txt b/tests/misc/autolinks_with_asterisks.txt deleted file mode 100644 index 24de5d9..0000000 --- a/tests/misc/autolinks_with_asterisks.txt +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/tests/misc/autolinks_with_asterisks_russian.html b/tests/misc/autolinks_with_asterisks_russian.html deleted file mode 100644 index 64cd635..0000000 --- a/tests/misc/autolinks_with_asterisks_russian.html +++ /dev/null @@ -1 +0,0 @@ -

http://some.site/нечто*очень*странное

\ No newline at end of file diff --git a/tests/misc/autolinks_with_asterisks_russian.txt b/tests/misc/autolinks_with_asterisks_russian.txt deleted file mode 100644 index 74465f1..0000000 --- a/tests/misc/autolinks_with_asterisks_russian.txt +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/tests/misc/backtick-escape.html b/tests/misc/backtick-escape.html deleted file mode 100644 index 07f5115..0000000 --- a/tests/misc/backtick-escape.html +++ /dev/null @@ -1,3 +0,0 @@ -

\`This should not be in code.\` -`This also should not be in code.` -`And finally this should not be in code.`

\ No newline at end of file diff --git a/tests/misc/backtick-escape.txt b/tests/misc/backtick-escape.txt deleted file mode 100644 index b4d80b2..0000000 --- a/tests/misc/backtick-escape.txt +++ /dev/null @@ -1,3 +0,0 @@ -\\`This should not be in code.\\` -\`This also should not be in code.\` -\`And finally this should not be in code.` diff --git a/tests/misc/benchmark.dat b/tests/misc/benchmark.dat deleted file mode 100644 index ac0334c..0000000 --- a/tests/misc/benchmark.dat +++ /dev/null @@ -1,56 +0,0 @@ -construction:0.000000:0.000000 -CRLF_line_ends:0.020000:0.000000 -adjacent-headers:0.020000:0.000000 -amp-in-url:0.020000:0.000000 -ampersand:0.010000:0.000000 -arabic:0.110000:0.000000 -attributes2:0.020000:0.000000 -bidi:0.310000:0.000000 -blank-block-quote:0.010000:0.000000 -blockquote:0.090000:0.000000 -blockquote-hr:0.060000:0.000000 -bold_links:0.020000:0.000000 -br:0.040000:0.000000 -bracket_re:7.490000:0.000000 -code-first-line:0.020000:0.000000 -comments:0.040000:0.000000 -div:0.040000:0.000000 -email:0.030000:0.000000 -funky-list:0.060000:0.000000 -h1:0.040000:0.000000 -hash:0.040000:0.000000 -headers:0.060000:0.000000 -hline:0.020000:0.000000 -html:0.090000:0.000000 -image:0.040000:0.000000 -image-2:0.060000:0.000000 -image_in_links:0.060000:0.000000 -inside_html:0.040000:0.000000 -japanese:0.150000:0.000000 -lazy-block-quote:0.050000:0.000000 -lists:0.110000:0.000000 -lists2:0.040000:0.000000 -lists3:0.040000:0.000000 -lists4:0.050000:0.000000 -lists5:0.070000:0.000000 -markup-inside-p:0.080000:0.000000 -mismatched-tags:0.070000:0.000000 -more_comments:0.060000:0.000000 -multi-line-tags:0.080000:0.000000 -multi-paragraph-block-quote:0.070000:0.000000 -multi-test:0.150000:0.000000 -multiline-comments:0.090000:0.000000 -normalize:0.060000:0.000000 -numeric-entity:0.090000:0.000000 -php:0.080000:0.000000 -pre:0.080000:0.000000 -russian:0.200000:0.000000 -some-test:0.200000:0.000000 -span:0.140000:0.000000 -strong-with-underscores:0.090000:0.000000 -stronintags:0.160000:0.000000 -tabs-in-lists:0.170000:0.000000 -two-spaces:0.160000:0.000000 -uche:0.150000:0.000000 -underscores:0.120000:0.000000 -url_spaces:0.120000:0.000000 diff --git a/tests/misc/bidi.html b/tests/misc/bidi.html deleted file mode 100644 index ffe04dc..0000000 --- a/tests/misc/bidi.html +++ /dev/null @@ -1,39 +0,0 @@ -

Python(パイソン)は、Guido van Rossum によって作られたオープンソースのオブジェクト指向スクリプト言語。Perlとともに欧米で広く普及している。イギリスのテレビ局 BBC が製作したコメディ番組『空飛ぶモンティ・パイソン』にちなんで名付けられた。 (Pythonには、爬虫類のニシキヘビの意味があり、Python言語のマスコットやアイコンとして使われることがある。)

-

|||||||||||||||||||||||||||||THIS SHOULD BE LTR|||||||||||||||||||||||||

-

|||||||||||||||||||||||||||||THIS SHOULD BE RTL|||||||||||||||||||||||||

-

(بايثون لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (THIS SHOULD BE LTR ) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوح

-

پایتون زبان برنامه‌نویسی تفسیری و سطح بالا ، شی‌گرا و یک زبان برنامه‌نویسی تفسیری سمت سرور قدرتمند است که توسط گیدو ون روسوم در سال ۱۹۹۰ ساخته شد. این زبان در ویژگی‌ها شبیه پرل، روبی، اسکیم، اسمال‌تاک و تی‌سی‌ال است و از مدیریت خودکار حافظه استفاده می‌کند

-

Python,是一种面向对象的、直譯式的计算机程序设计语言,也是一种功能强大而完善的通用型语言,已经具有十多年的发展历史,成熟且稳定。

-

ބްލޫ ވޭލްގެ ދޫ މަތީގައި އެއްފަހަރާ 50 މީހުންނަށް ތިބެވިދާނެވެ. ބޮޑު މަހުގެ ދުލަކީ އެހާމެ ބޮޑު އެއްޗެކެވެ.

-

உருது 13ஆம் நூற்றாண்டில் உருவான ஒரு இந்தோ-ஐரோப்பிய மொழியாகும். உருது, ஹிந்தியுடன் சேர்த்து "ஹிந்துஸ்தானி" என அழைக்கப்படுகின்றது. மண்டரின், ஆங்கிலம் ஆகியவற்றுக்கு அடுத்தபடியாக மூன்றாவது கூடிய அளவு மக்களால் புரிந்து கொள்ளப்படக்கூடியது ஹிந்துஸ்தானியேயாகும். தாய் மொழியாகப் பேசுபவர்கள் எண்ணிக்கையின் அடிப்படையில் உருது உலகின் 20 ஆவது பெரிய மொழியாகும். 6 கோடி மக்கள் இதனைத் தாய் மொழியாகக் கொண்டுள்ளார்கள். இரண்டாவது மொழியாகக் கொண்டுள்ளவர்கள் உட்பட 11 கோடிப் பேர் இதனைப் பேசுகிறார்கள். உருது பாகிஸ்தானின் அரசகரும மொழியாகவும், இந்தியாவின் அரசகரும மொழிகளுள் ஒன்றாகவும் விளங்குகிறது.

-

اردو ہندوآریائی زبانوں کی ہندويورپی شاخ کی ایک زبان ہے جو تيرھويں صدی ميں بر صغير ميں پيدا ہوئی ـ اردو پاکستان کی سرکاری زبان ہے اور بھارت کی سرکاری زبانوں ميں سے ايک ہے۔ اردو بھارت ميں 5 کروڑ اور پاکستان ميں 1 کروڑ لوگوں کی مادری زبان ہے مگر اسے بھارت اور پاکستان کے تقریباً 50 کروڑ لوگ بول اور سمجھ سکتے ھیں ۔ جن میں سے تقریباً 10.5 کروڑ لوگ اسے باقاعدہ بولتے ھیں۔

-

بايثون

-

بايثون لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (OOP) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوحة المصدر. صُنفت بالأساس كلغة تفسيرية ، بايثون مصممة أصلاً للأداء بعض المهام الخاصة أو المحدودة. إلا أنه يمكن استخدامها بايثون لإنجاز المشاريع الضخمه كأي لغة برمجية أخرى، غالباً ما يُنصح المبتدئين في ميدان البرمجة بتعلم هذه اللغة لأنها من بين أسهل اللغات البرمجية تعلماً.

-

|||||||||||||||||||||||||||||THIS SHOULD BE RTL|||||||||||||||||||||||||

-

(نشأت بايثون في مركز CWI (مركز العلوم والحاسب الآلي) بأمستردام على يد جويدو فان رُزوم. تم تطويرها بلغة C. أطلق فان رُزوم اسم "بايثون" على لغته تعبيرًا عن إعجابه بفِرقَة مسرحية هزلية شهيرة من بريطانيا، كانت تطلق على نفسها اسم مونتي بايثون Monty Python.

-

تتميز بايثون بمجتمعها النشط ، كما أن لها الكثير من المكتبات البرمجية ذات الأغراض الخاصة والتي برمجها أشخاص من مجتمع هذه اللغة ، مثلاً مكتبة PyGame التي توفر مجموعه من الوظائف من اجل برمجة الالعاب. ويمكن لبايثون التعامل مع العديد من أنواع قواعد البيانات مثل MySQL وغيره.

-

أمثلة

-

مثال Hello World!

-
print "Hello World!"
-
-

مثال لاستخراج المضروب Factorial :

-
num = 1
-x = raw_input('Insert the number please ')
-x = int(x)
-
-if x > 69:
- print 'Math Error !'
-else:
- while x > 1:
-  num *= x
-  x = x-1
-
- print num
-
-

وصلات خارجية

- -

بذرة حاس

-

Недвард «Нед» Фландерс (Nedward «Ned» Flanders) — вымышленный персонаж мультсериала «[Симпсоны][]», озвученный Гарри Ширером. Он и его семья живут по соседству от семьи Симпсонов. Набожный христианин, Нед является одним из столпов морали Спрингфилда. В эпизоде «Alone Again, Natura-Diddily» он овдовел, его жена Мод погибла в результате несчастного случая.

-

Нед был одним из первых персонажей в мультсериале, который не был членом семьи Симпсонов. Начиная с первых серий, он регулярно появляется в «Симпсонах». Считается, что Нед Фландерс был назван в честь улицы Northeast Flanders St. в Портленде, Орегон, родном городе создателя мультсериала Мэтта Грейнинга]]. Надпись на указателе улицы NE Flanders St. хулиганы часто исправляли на NED Flanders St.

\ No newline at end of file diff --git a/tests/misc/bidi.txt b/tests/misc/bidi.txt deleted file mode 100644 index f11ff1c..0000000 --- a/tests/misc/bidi.txt +++ /dev/null @@ -1,68 +0,0 @@ -**Python**(パイソン)は、[Guido van Rossum](http://en.wikipedia.org/wiki/Guido_van_Rossum) によって作られたオープンソースのオブジェクト指向スクリプト言語。[Perl](http://ja.wikipedia.org/wiki/Perl)とともに欧米で広く普及している。イギリスのテレビ局 BBC が製作したコメディ番組『空飛ぶモンティ・パイソン』にちなんで名付けられた。 (Pythonには、爬虫類のニシキヘビの意味があり、Python言語のマスコットやアイコンとして使われることがある。) - -|||||||||||||||||||||||||||||THIS SHOULD BE LTR||||||||||||||||||||||||| - -|||||||||||||||||||||||||||||THIS SHOULD BE RTL||||||||||||||||||||||||| {@dir=rtl} - - -(**بايثون** لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (THIS SHOULD BE LTR ) وقابلة للتطوير {@dir=ltr} بالإضافة إلى أنها مجانية و مفتوح - - - - - -پایتون زبان برنامه‌نویسی تفسیری و سطح بالا ، شی‌گرا و یک زبان برنامه‌نویسی تفسیری سمت سرور قدرتمند است که توسط گیدو ون روسوم در سال ۱۹۹۰ ساخته شد. این زبان در ویژگی‌ها شبیه پرل، روبی، اسکیم، اسمال‌تاک و تی‌سی‌ال است و از مدیریت خودکار حافظه استفاده می‌کند - -Python,是一种面向对象的、直譯式的计算机程序设计语言,也是一种功能强大而完善的通用型语言,已经具有十多年的发展历史,成熟且稳定。 - -ބްލޫ ވޭލްގެ ދޫ މަތީގައި އެއްފަހަރާ 50 މީހުންނަށް ތިބެވިދާނެވެ. ބޮޑު މަހުގެ ދުލަކީ އެހާމެ ބޮޑު އެއްޗެކެވެ. - -**உருது** 13ஆம் நூற்றாண்டில் உருவான ஒரு இந்தோ-ஐரோப்பிய மொழியாகும். உருது, ஹிந்தியுடன் சேர்த்து "ஹிந்துஸ்தானி" என அழைக்கப்படுகின்றது. மண்டரின், ஆங்கிலம் ஆகியவற்றுக்கு அடுத்தபடியாக மூன்றாவது கூடிய அளவு மக்களால் புரிந்து கொள்ளப்படக்கூடியது ஹிந்துஸ்தானியேயாகும். தாய் மொழியாகப் பேசுபவர்கள் எண்ணிக்கையின் அடிப்படையில் உருது உலகின் 20 ஆவது பெரிய மொழியாகும். 6 கோடி மக்கள் இதனைத் தாய் மொழியாகக் கொண்டுள்ளார்கள். இரண்டாவது மொழியாகக் கொண்டுள்ளவர்கள் உட்பட 11 கோடிப் பேர் இதனைப் பேசுகிறார்கள். உருது பாகிஸ்தானின் அரசகரும மொழியாகவும், இந்தியாவின் அரசகரும மொழிகளுள் ஒன்றாகவும் விளங்குகிறது. - -اردو ہندوآریائی زبانوں کی ہندويورپی شاخ کی ایک زبان ہے جو تيرھويں صدی ميں بر صغير ميں پيدا ہوئی ـ اردو پاکستان کی سرکاری زبان ہے اور بھارت کی سرکاری زبانوں ميں سے ايک ہے۔ اردو بھارت ميں 5 کروڑ اور پاکستان ميں 1 کروڑ لوگوں کی مادری زبان ہے مگر اسے بھارت اور پاکستان کے تقریباً 50 کروڑ لوگ بول اور سمجھ سکتے ھیں ۔ جن میں سے تقریباً 10.5 کروڑ لوگ اسے باقاعدہ بولتے ھیں۔ - -بايثون -===== - -**بايثون** لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (OOP) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوحة المصدر. صُنفت بالأساس كلغة تفسيرية ، بايثون مصممة أصلاً للأداء بعض المهام الخاصة أو المحدودة. إلا أنه يمكن استخدامها بايثون لإنجاز المشاريع الضخمه كأي لغة برمجية أخرى، غالباً ما يُنصح المبتدئين في ميدان البرمجة بتعلم هذه اللغة لأنها من بين أسهل اللغات البرمجية تعلماً. - -|||||||||||||||||||||||||||||THIS SHOULD BE RTL||||||||||||||||||||||||| - -(نشأت بايثون في مركز CWI (مركز العلوم والحاسب الآلي) بأمستردام على يد جويدو فان رُزوم. تم تطويرها بلغة C. أطلق فان رُزوم اسم "بايثون" على لغته تعبيرًا عن إعجابه بفِرقَة مسرحية هزلية شهيرة من بريطانيا، كانت تطلق على نفسها اسم مونتي بايثون Monty Python. - -تتميز بايثون بمجتمعها النشط ، كما أن لها الكثير من المكتبات البرمجية ذات الأغراض الخاصة والتي برمجها أشخاص من مجتمع هذه اللغة ، مثلاً مكتبة PyGame التي توفر مجموعه من الوظائف من اجل برمجة الالعاب. ويمكن لبايثون التعامل مع العديد من أنواع قواعد البيانات مثل MySQL وغيره. - -##أمثلة -مثال Hello World! - - print "Hello World!" - - -مثال لاستخراج المضروب Factorial : - - num = 1 - x = raw_input('Insert the number please ') - x = int(x) - - if x > 69: - print 'Math Error !' - else: - while x > 1: - num *= x - x = x-1 - - print num - - - -##وصلات خارجية -* [الموقع الرسمي للغة بايثون](http://www.python.org) - - بذرة حاس - - -**Недвард «Нед» Фландерс** (Nedward «Ned» Flanders) — вымышленный персонаж мультсериала «[Симпсоны][]», озвученный Гарри Ширером. Он и его семья живут по соседству от семьи Симпсонов. Набожный христианин, Нед является одним из столпов морали Спрингфилда. В эпизоде «Alone Again, Natura-Diddily» он овдовел, его жена Мод погибла в результате несчастного случая. - -Нед был одним из первых персонажей в мультсериале, который не был членом семьи Симпсонов. Начиная с первых серий, он регулярно появляется в «Симпсонах». Считается, что Нед Фландерс был назван в честь улицы *Northeast Flanders St.* в [Портленде](http://www.portland.gov), Орегон, родном городе создателя мультсериала Мэтта Грейнинга]]. Надпись на указателе улицы *NE Flanders St.* хулиганы часто исправляли на _NED Flanders St._ - - diff --git a/tests/misc/blank-block-quote.html b/tests/misc/blank-block-quote.html deleted file mode 100644 index 23df17a..0000000 --- a/tests/misc/blank-block-quote.html +++ /dev/null @@ -1,3 +0,0 @@ -

aaaaaaaaaaa

-
-

bbbbbbbbbbb

\ No newline at end of file diff --git a/tests/misc/blank-block-quote.txt b/tests/misc/blank-block-quote.txt deleted file mode 100644 index 75bfc74..0000000 --- a/tests/misc/blank-block-quote.txt +++ /dev/null @@ -1,6 +0,0 @@ - -aaaaaaaaaaa - -> - -bbbbbbbbbbb diff --git a/tests/misc/blockquote-below-paragraph.html b/tests/misc/blockquote-below-paragraph.html deleted file mode 100644 index a138933..0000000 --- a/tests/misc/blockquote-below-paragraph.html +++ /dev/null @@ -1,15 +0,0 @@ -

Paragraph

-
-

Block quote -Yep

-
-

Paragraph

-
-

no space -Nope

-
-

Paragraph one

-
-

blockquote -More blockquote.

-
\ No newline at end of file diff --git a/tests/misc/blockquote-below-paragraph.txt b/tests/misc/blockquote-below-paragraph.txt deleted file mode 100644 index 529e5a9..0000000 --- a/tests/misc/blockquote-below-paragraph.txt +++ /dev/null @@ -1,11 +0,0 @@ -Paragraph -> Block quote -> Yep - -Paragraph ->no space ->Nope - -Paragraph one -> blockquote -More blockquote. diff --git a/tests/misc/blockquote-hr.html b/tests/misc/blockquote-hr.html deleted file mode 100644 index 61c1a3c..0000000 --- a/tests/misc/blockquote-hr.html +++ /dev/null @@ -1,16 +0,0 @@ -

This is a paragraph.

-
-
-

Block quote with horizontal lines.

-
-
-

Double block quote.

-
-

End of the double block quote.

-
-

A new paragraph. -With multiple lines. -Even a lazy line.

-
-

The last line.

-
\ No newline at end of file diff --git a/tests/misc/blockquote-hr.txt b/tests/misc/blockquote-hr.txt deleted file mode 100644 index ef9c44f..0000000 --- a/tests/misc/blockquote-hr.txt +++ /dev/null @@ -1,21 +0,0 @@ -This is a paragraph. - ---- - -> Block quote with horizontal lines. - -> --- - -> > Double block quote. - -> > --- - -> > End of the double block quote. - -> A new paragraph. -> With multiple lines. -Even a lazy line. - -> --- - -> The last line. diff --git a/tests/misc/blockquote.html b/tests/misc/blockquote.html deleted file mode 100644 index 4481d51..0000000 --- a/tests/misc/blockquote.html +++ /dev/null @@ -1,24 +0,0 @@ -
-

blockquote with no whitespace before >.

-
-

foo

-
-

blockquote with one space before the >.

-
-

bar

-
-

blockquote with 2 spaces.

-
-

baz

-
-

this has three spaces so its a paragraph.

-
-

blah

-
> this one had four so it's a code block.
-
-
-
-

this nested blockquote has 0 on level one and 3 (one after the first > + 2 more) on level 2.

-

and this has 4 on level 2 - another code block.

-
-
\ No newline at end of file diff --git a/tests/misc/blockquote.txt b/tests/misc/blockquote.txt deleted file mode 100644 index be3ff90..0000000 --- a/tests/misc/blockquote.txt +++ /dev/null @@ -1,21 +0,0 @@ -> blockquote with no whitespace before `>`. - -foo - - > blockquote with one space before the `>`. - -bar - - > blockquote with 2 spaces. - -baz - - > this has three spaces so its a paragraph. - -blah - - > this one had four so it's a code block. - -> > this nested blockquote has 0 on level one and 3 (one after the first `>` + 2 more) on level 2. - -> > and this has 4 on level 2 - another code block. diff --git a/tests/misc/bold_links.html b/tests/misc/bold_links.html deleted file mode 100644 index 5a78e57..0000000 --- a/tests/misc/bold_links.html +++ /dev/null @@ -1 +0,0 @@ -

bold link

\ No newline at end of file diff --git a/tests/misc/bold_links.txt b/tests/misc/bold_links.txt deleted file mode 100644 index a07f441..0000000 --- a/tests/misc/bold_links.txt +++ /dev/null @@ -1 +0,0 @@ -**bold [link](http://example.com)** diff --git a/tests/misc/br.html b/tests/misc/br.html deleted file mode 100644 index 08563a5..0000000 --- a/tests/misc/br.html +++ /dev/null @@ -1,11 +0,0 @@ -

Output:

-
<p>Some of these words <em>are emphasized</em>.
-Some of these words <em>are emphasized also</em>.</p>
-
-<p>Use two asterisks for <strong>strong emphasis</strong>.
-Or, if you prefer, <strong>use two underscores instead</strong>.</p>
-
-

Lists

-

Unordered (bulleted) lists use asterisks, pluses, and hyphens (*, -+, and -) as list markers. These three markers are -interchangable; this:

\ No newline at end of file diff --git a/tests/misc/br.txt b/tests/misc/br.txt deleted file mode 100644 index 59d29e0..0000000 --- a/tests/misc/br.txt +++ /dev/null @@ -1,16 +0,0 @@ -Output: - -

Some of these words are emphasized. - Some of these words are emphasized also.

- -

Use two asterisks for strong emphasis. - Or, if you prefer, use two underscores instead.

- - - -## Lists ## - -Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`, -`+`, and `-`) as list markers. These three markers are -interchangable; this: - diff --git a/tests/misc/bracket_re.html b/tests/misc/bracket_re.html deleted file mode 100644 index f48a612..0000000 --- a/tests/misc/bracket_re.html +++ /dev/null @@ -1,60 +0,0 @@ -

[x -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx

\ No newline at end of file diff --git a/tests/misc/bracket_re.txt b/tests/misc/bracket_re.txt deleted file mode 100644 index 545e061..0000000 --- a/tests/misc/bracket_re.txt +++ /dev/null @@ -1,61 +0,0 @@ - -[x -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx -xxx xxx xxx xxx xxx xxx xxx xxx diff --git a/tests/misc/code-first-line.html b/tests/misc/code-first-line.html deleted file mode 100644 index 1fb0b7c..0000000 --- a/tests/misc/code-first-line.html +++ /dev/null @@ -1,2 +0,0 @@ -
print "This is a code block."
-
\ No newline at end of file diff --git a/tests/misc/code-first-line.txt b/tests/misc/code-first-line.txt deleted file mode 100644 index 952614d..0000000 --- a/tests/misc/code-first-line.txt +++ /dev/null @@ -1 +0,0 @@ - print "This is a code block." diff --git a/tests/misc/comments.html b/tests/misc/comments.html deleted file mode 100644 index 005a755..0000000 --- a/tests/misc/comments.html +++ /dev/null @@ -1,5 +0,0 @@ -

X<0

-

X>0

- - -
as if
\ No newline at end of file diff --git a/tests/misc/comments.txt b/tests/misc/comments.txt deleted file mode 100644 index 68302b0..0000000 --- a/tests/misc/comments.txt +++ /dev/null @@ -1,7 +0,0 @@ -X<0 - -X>0 - - - -
as if
diff --git a/tests/misc/div.html b/tests/misc/div.html deleted file mode 100644 index 7cd0d6d..0000000 --- a/tests/misc/div.html +++ /dev/null @@ -1,4 +0,0 @@ - \ No newline at end of file diff --git a/tests/misc/div.txt b/tests/misc/div.txt deleted file mode 100644 index ca87745..0000000 --- a/tests/misc/div.txt +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/tests/misc/em-around-links.html b/tests/misc/em-around-links.html deleted file mode 100644 index fafac28..0000000 --- a/tests/misc/em-around-links.html +++ /dev/null @@ -1,13 +0,0 @@ -

Title

- -

Python in Markdown by some -great folks - This does work as expected.

\ No newline at end of file diff --git a/tests/misc/em-around-links.txt b/tests/misc/em-around-links.txt deleted file mode 100644 index 5b15be4..0000000 --- a/tests/misc/em-around-links.txt +++ /dev/null @@ -1,14 +0,0 @@ -# Title - - - *[Python in Markdown](http://www.freewisdom.org/projects/python-markdown/) by some - great folks* - This *does* work as expected. - - _[Python in Markdown](http://www.freewisdom.org/projects/python-markdown/) by some - great folks_ - This *does* work as expected. - - [_Python in Markdown_](http://www.freewisdom.org/projects/python-markdown/) by some - great folks - This *does* work as expected. - - [_Python in Markdown_](http://www.freewisdom.org/projects/python-markdown/) _by some - great folks_ - This *does* work as expected. - -_[Python in Markdown](http://www.freewisdom.org/projects/python-markdown/) by some -great folks_ - This *does* work as expected. - diff --git a/tests/misc/em_strong.html b/tests/misc/em_strong.html deleted file mode 100644 index 75c92d8..0000000 --- a/tests/misc/em_strong.html +++ /dev/null @@ -1,10 +0,0 @@ -

One asterisk: *

-

One underscore: _

-

Two asterisks: **

-

With spaces: * *

-

Two underscores __

-

with spaces: _ _

-

three asterisks: ***

-

with spaces: * * *

-

three underscores: ___

-

with spaces: _ _ _

\ No newline at end of file diff --git a/tests/misc/em_strong.txt b/tests/misc/em_strong.txt deleted file mode 100644 index d0774ad..0000000 --- a/tests/misc/em_strong.txt +++ /dev/null @@ -1,20 +0,0 @@ -One asterisk: * - -One underscore: _ - -Two asterisks: ** - -With spaces: * * - -Two underscores __ - -with spaces: _ _ - -three asterisks: *** - -with spaces: * * * - -three underscores: ___ - -with spaces: _ _ _ - diff --git a/tests/misc/email.html b/tests/misc/email.html deleted file mode 100644 index 0d033bb..0000000 --- a/tests/misc/email.html +++ /dev/null @@ -1,2 +0,0 @@ -

asdfasdfadsfasd yuri@freewisdom.org or you can say -instead yuri@freewisdom.org

\ No newline at end of file diff --git a/tests/misc/email.txt b/tests/misc/email.txt deleted file mode 100644 index ece8801..0000000 --- a/tests/misc/email.txt +++ /dev/null @@ -1,3 +0,0 @@ - -asdfasdfadsfasd or you can say -instead diff --git a/tests/misc/funky-list.html b/tests/misc/funky-list.html deleted file mode 100644 index 313db8f..0000000 --- a/tests/misc/funky-list.html +++ /dev/null @@ -1,11 +0,0 @@ -
    -
  1. this starts a list with numbers
  2. -
  3. this will show as number "2"
  4. -
  5. this will show as number "3."
  6. -
  7. any number, +, -, or * will keep the list going.
  8. -
-

aaaaaaaaaaaaaaa

-
    -
  • now a normal list
  • -
  • and more
  • -
\ No newline at end of file diff --git a/tests/misc/funky-list.txt b/tests/misc/funky-list.txt deleted file mode 100644 index 48ecd60..0000000 --- a/tests/misc/funky-list.txt +++ /dev/null @@ -1,9 +0,0 @@ -1. this starts a list *with* numbers -+ this will show as number "2" -* this will show as number "3." -9. any number, +, -, or * will keep the list going. - -aaaaaaaaaaaaaaa - -- now a normal list -- and more diff --git a/tests/misc/h1.html b/tests/misc/h1.html deleted file mode 100644 index fbf9b4d..0000000 --- a/tests/misc/h1.html +++ /dev/null @@ -1,3 +0,0 @@ -

Header

-

Header 2

-

H3

\ No newline at end of file diff --git a/tests/misc/h1.txt b/tests/misc/h1.txt deleted file mode 100644 index 0a1c8f9..0000000 --- a/tests/misc/h1.txt +++ /dev/null @@ -1,7 +0,0 @@ -Header ------- - -Header 2 -======== - -### H3 diff --git a/tests/misc/hash.html b/tests/misc/hash.html deleted file mode 100644 index 1865994..0000000 --- a/tests/misc/hash.html +++ /dev/null @@ -1,11 +0,0 @@ -

a

-
-#!/usr/bin/python
-hello
- -

a

-
-!/usr/bin/python
-hello
- -

a

\ No newline at end of file diff --git a/tests/misc/hash.txt b/tests/misc/hash.txt deleted file mode 100644 index 634758d..0000000 --- a/tests/misc/hash.txt +++ /dev/null @@ -1,13 +0,0 @@ -a - -
-#!/usr/bin/python
-hello
- -a - -
-!/usr/bin/python
-hello
- -a diff --git a/tests/misc/headers.html b/tests/misc/headers.html deleted file mode 100644 index 2a737e2..0000000 --- a/tests/misc/headers.html +++ /dev/null @@ -1,10 +0,0 @@ -

Hello world

-

Line 2 -Line 3

-

[Markdown][5]

-

Markdown

-

[5]: http://foo.com/

-

Issue #1: Markdown

-

Text

-

Header

-

Some other text

\ No newline at end of file diff --git a/tests/misc/headers.txt b/tests/misc/headers.txt deleted file mode 100644 index db114ed..0000000 --- a/tests/misc/headers.txt +++ /dev/null @@ -1,15 +0,0 @@ -### Hello world -Line 2 -Line 3 - -# [Markdown][5] - -# [Markdown](http://some.link.com/) - -# [5]: http://foo.com/ - -# Issue #1: Markdown - -Text -# Header -Some other text diff --git a/tests/misc/hline.html b/tests/misc/hline.html deleted file mode 100644 index b18a311..0000000 --- a/tests/misc/hline.html +++ /dev/null @@ -1,2 +0,0 @@ -

Header

-

Next line

\ No newline at end of file diff --git a/tests/misc/hline.txt b/tests/misc/hline.txt deleted file mode 100644 index e39b7a2..0000000 --- a/tests/misc/hline.txt +++ /dev/null @@ -1,5 +0,0 @@ - -#Header -Next line - - diff --git a/tests/misc/html-comments.html b/tests/misc/html-comments.html deleted file mode 100644 index 7b36246..0000000 --- a/tests/misc/html-comments.html +++ /dev/null @@ -1,2 +0,0 @@ -

Here is HTML -and once more

\ No newline at end of file diff --git a/tests/misc/html-comments.txt b/tests/misc/html-comments.txt deleted file mode 100644 index cac4da5..0000000 --- a/tests/misc/html-comments.txt +++ /dev/null @@ -1,2 +0,0 @@ -Here is HTML -and once more

diff --git a/tests/misc/html.html b/tests/misc/html.html deleted file mode 100644 index 81ac5ee..0000000 --- a/tests/misc/html.html +++ /dev/null @@ -1,9 +0,0 @@ -

Block level html

- -

Some inline stuff.
-

-

Now some arbitrary tags.

-
More block level html.
- -

And of course .

-

this . - -[this ) - diff --git a/tests/misc/image-2.html b/tests/misc/image-2.html deleted file mode 100644 index 9343d29..0000000 --- a/tests/misc/image-2.html +++ /dev/null @@ -1,2 +0,0 @@ -

link!

-

link

\ No newline at end of file diff --git a/tests/misc/image-2.txt b/tests/misc/image-2.txt deleted file mode 100644 index 6228383..0000000 --- a/tests/misc/image-2.txt +++ /dev/null @@ -1,3 +0,0 @@ -[*link!*](http://src.com/) - -*[link](http://www.freewisdom.org)* diff --git a/tests/misc/image.html b/tests/misc/image.html deleted file mode 100644 index 16be2d5..0000000 --- a/tests/misc/image.html +++ /dev/null @@ -1 +0,0 @@ -

Poster

\ No newline at end of file diff --git a/tests/misc/image.txt b/tests/misc/image.txt deleted file mode 100644 index 5553bd4..0000000 --- a/tests/misc/image.txt +++ /dev/null @@ -1,2 +0,0 @@ - -![Poster](http://humane_man.jpg "The most humane man.") diff --git a/tests/misc/image_in_links.html b/tests/misc/image_in_links.html deleted file mode 100644 index 5a8cdc3..0000000 --- a/tests/misc/image_in_links.html +++ /dev/null @@ -1 +0,0 @@ -

altname

\ No newline at end of file diff --git a/tests/misc/image_in_links.txt b/tests/misc/image_in_links.txt deleted file mode 100644 index 6d739e6..0000000 --- a/tests/misc/image_in_links.txt +++ /dev/null @@ -1,3 +0,0 @@ - - -[![altname](path/to/img_thumb.png)](path/to/image.png) diff --git a/tests/misc/inside_html.html b/tests/misc/inside_html.html deleted file mode 100644 index 6343dd9..0000000 --- a/tests/misc/inside_html.html +++ /dev/null @@ -1 +0,0 @@ -

ok?

\ No newline at end of file diff --git a/tests/misc/inside_html.txt b/tests/misc/inside_html.txt deleted file mode 100644 index 4f068bf..0000000 --- a/tests/misc/inside_html.txt +++ /dev/null @@ -1 +0,0 @@ - __ok__? diff --git a/tests/misc/japanese.html b/tests/misc/japanese.html deleted file mode 100644 index 930891b..0000000 --- a/tests/misc/japanese.html +++ /dev/null @@ -1,11 +0,0 @@ -

パイソン (Python)

-

Python(パイソン)は、Guido van Rossum によって作られたオープンソースのオブジェクト指向スクリプト言語。Perlとともに欧米で広く普及している。イギリスのテレビ局 BBC が製作したコメディ番組『空飛ぶモンティ・パイソン』にちなんで名付けられた。 (Pythonには、爬虫類のニシキヘビの意味があり、Python言語のマスコットやアイコンとして使われることがある。)

-

概要

-

プログラミング言語 Python は初心者から専門家まで幅広いユーザ層を獲得している。利用目的は汎用で、方向性としてはJavaに近い。ただし、最初からネットワーク利用をメインとして考えられているJavaよりセキュリティについてはやや寛大である。多くのプラットフォームをサポートしており(⇒動作するプラットフォーム)、豊富なライブラリがあることから、産業界でも利用が増えつつある。また、Pythonは純粋なプログラミング言語のほかにも、多くの異なる言語で書かれたモジュールをまとめる糊言語のひとつとして位置づけることができる。実際Pythonは多くの商用アプリケーションでスクリプト言語として採用されている(⇒Pythonを使っている製品あるいはソフトウェアの一覧)。豊富なドキュメントをもち、Unicodeによる文字列操作をサポートしており、日本語処理も標準で可能である。

-

Python は基本的にインタプリタ上で実行されることを念頭において設計されており、以下のような特徴をもっている:

-
    -
  • 動的な型付け。
  • -
  • オブジェクトのメンバに対するアクセスが制限されていない。(属性や専用のメソッドフックを実装することによって制限は可能。)
  • -
  • モジュール、クラス、オブジェクト等の言語の要素が内部からアクセス可能であり、リフレクションを利用した記述が可能。
  • -
-

また、Pythonではインデントによりブロックを指定する構文を採用している(⇒オフサイドルール)。この構文はPythonに慣れたユーザからは称賛をもって受け入れられているが、他の言語のユーザからは批判も多い。このほかにも、大きすぎる実行ファイルや、Javaに比べて遅い処理速度などが欠点として指摘されている。しかし プロトタイピング の際にはこれらの点はさして問題とはならないことから、研究開発部門では頻繁に利用されている。

\ No newline at end of file diff --git a/tests/misc/japanese.txt b/tests/misc/japanese.txt deleted file mode 100644 index b2bd38c..0000000 --- a/tests/misc/japanese.txt +++ /dev/null @@ -1,15 +0,0 @@ -パイソン (Python) -======= - -**Python**(パイソン)は、[Guido van Rossum](http://en.wikipedia.org/wiki/Guido_van_Rossum) によって作られたオープンソースのオブジェクト指向スクリプト言語。[Perl](http://ja.wikipedia.org/wiki/Perl)とともに欧米で広く普及している。イギリスのテレビ局 BBC が製作したコメディ番組『空飛ぶモンティ・パイソン』にちなんで名付けられた。 (Pythonには、爬虫類のニシキヘビの意味があり、Python言語のマスコットやアイコンとして使われることがある。) - -## 概要 -プログラミング言語 Python は初心者から専門家まで幅広いユーザ層を獲得している。利用目的は汎用で、方向性としてはJavaに近い。ただし、最初からネットワーク利用をメインとして考えられているJavaよりセキュリティについてはやや寛大である。多くのプラットフォームをサポートしており(⇒[動作するプラットフォーム](#somelink))、豊富なライブラリがあることから、産業界でも利用が増えつつある。また、Pythonは純粋なプログラミング言語のほかにも、多くの異なる言語で書かれたモジュールをまとめる糊言語のひとつとして位置づけることができる。実際Pythonは多くの商用アプリケーションでスクリプト言語として採用されている(⇒Pythonを使っている製品あるいはソフトウェアの一覧)。豊富なドキュメントをもち、Unicodeによる文字列操作をサポートしており、日本語処理も標準で可能である。 - -Python は基本的にインタプリタ上で実行されることを念頭において設計されており、以下のような特徴をもっている: - -* 動的な型付け。 -* オブジェクトのメンバに対するアクセスが制限されていない。(属性や専用のメソッドフックを実装することによって制限は可能。) -* モジュール、クラス、オブジェクト等の言語の要素が内部からアクセス可能であり、リフレクションを利用した記述が可能。 - -また、Pythonではインデントによりブロックを指定する構文を採用している(⇒[オフサイドルール](#jklj))。この構文はPythonに慣れたユーザからは称賛をもって受け入れられているが、他の言語のユーザからは批判も多い。このほかにも、大きすぎる実行ファイルや、Javaに比べて遅い処理速度などが欠点として指摘されている。しかし **プロトタイピング** の際にはこれらの点はさして問題とはならないことから、研究開発部門では頻繁に利用されている。 diff --git a/tests/misc/lazy-block-quote.html b/tests/misc/lazy-block-quote.html deleted file mode 100644 index 7a88263..0000000 --- a/tests/misc/lazy-block-quote.html +++ /dev/null @@ -1,6 +0,0 @@ -
-

Line one of lazy block quote. -Line two of lazy block quote.

-

Line one of paragraph two. -Line two of paragraph two.

-
\ No newline at end of file diff --git a/tests/misc/lazy-block-quote.txt b/tests/misc/lazy-block-quote.txt deleted file mode 100644 index e7c17ca..0000000 --- a/tests/misc/lazy-block-quote.txt +++ /dev/null @@ -1,5 +0,0 @@ -> Line one of lazy block quote. -Line two of lazy block quote. - -> Line one of paragraph two. -Line two of paragraph two. diff --git a/tests/misc/link-with-parenthesis.html b/tests/misc/link-with-parenthesis.html deleted file mode 100644 index a56ed8d..0000000 --- a/tests/misc/link-with-parenthesis.html +++ /dev/null @@ -1 +0,0 @@ -

ZIP archives

\ No newline at end of file diff --git a/tests/misc/link-with-parenthesis.txt b/tests/misc/link-with-parenthesis.txt deleted file mode 100644 index 8affc98..0000000 --- a/tests/misc/link-with-parenthesis.txt +++ /dev/null @@ -1 +0,0 @@ -[ZIP archives](http://en.wikipedia.org/wiki/ZIP_(file_format) "ZIP (file format) - Wikipedia, the free encyclopedia") diff --git a/tests/misc/lists.html b/tests/misc/lists.html deleted file mode 100644 index bf4a02b..0000000 --- a/tests/misc/lists.html +++ /dev/null @@ -1,36 +0,0 @@ -
    -
  • A multi-paragraph list, -unindented.
  • -
-

Simple tight list

-
    -
  • Uno
  • -
  • Due
  • -
  • Tri
  • -
-

A singleton tight list:

-
    -
  • Uno
  • -
-

A lose list:

-
    -
  • -

    One

    -
  • -
  • -

    Two

    -
  • -
  • -

    Three

    -
  • -
-

A lose list with paragraphs

-
    -
  • -

    One one one one

    -

    one one one one

    -
  • -
  • -

    Two two two two

    -
  • -
\ No newline at end of file diff --git a/tests/misc/lists.txt b/tests/misc/lists.txt deleted file mode 100644 index 6db0dc3..0000000 --- a/tests/misc/lists.txt +++ /dev/null @@ -1,31 +0,0 @@ - -* A multi-paragraph list, -unindented. - - - -Simple tight list - -* Uno -* Due -* Tri - -A singleton tight list: - -* Uno - -A lose list: - -* One - -* Two - -* Three - -A lose list with paragraphs - -* One one one one - - one one one one - -* Two two two two diff --git a/tests/misc/lists2.html b/tests/misc/lists2.html deleted file mode 100644 index 991395b..0000000 --- a/tests/misc/lists2.html +++ /dev/null @@ -1,5 +0,0 @@ -
    -
  • blah blah blah -sdf asdf asdf asdf asdf -asda asdf asdfasd
  • -
\ No newline at end of file diff --git a/tests/misc/lists2.txt b/tests/misc/lists2.txt deleted file mode 100644 index cbff761..0000000 --- a/tests/misc/lists2.txt +++ /dev/null @@ -1,3 +0,0 @@ -* blah blah blah -sdf asdf asdf asdf asdf -asda asdf asdfasd diff --git a/tests/misc/lists3.html b/tests/misc/lists3.html deleted file mode 100644 index 991395b..0000000 --- a/tests/misc/lists3.html +++ /dev/null @@ -1,5 +0,0 @@ -
    -
  • blah blah blah -sdf asdf asdf asdf asdf -asda asdf asdfasd
  • -
\ No newline at end of file diff --git a/tests/misc/lists3.txt b/tests/misc/lists3.txt deleted file mode 100644 index 6b45bd4..0000000 --- a/tests/misc/lists3.txt +++ /dev/null @@ -1,3 +0,0 @@ -* blah blah blah - sdf asdf asdf asdf asdf - asda asdf asdfasd diff --git a/tests/misc/lists4.html b/tests/misc/lists4.html deleted file mode 100644 index 4b6b32c..0000000 --- a/tests/misc/lists4.html +++ /dev/null @@ -1,8 +0,0 @@ -
    -
  • item1
  • -
  • item2
      -
    1. Number 1
    2. -
    3. Number 2
    4. -
    -
  • -
\ No newline at end of file diff --git a/tests/misc/lists4.txt b/tests/misc/lists4.txt deleted file mode 100644 index a21493d..0000000 --- a/tests/misc/lists4.txt +++ /dev/null @@ -1,5 +0,0 @@ - -* item1 -* item2 - 1. Number 1 - 2. Number 2 diff --git a/tests/misc/lists5.html b/tests/misc/lists5.html deleted file mode 100644 index c3dbda4..0000000 --- a/tests/misc/lists5.html +++ /dev/null @@ -1,14 +0,0 @@ -
-

This is a test of a block quote -With just two lines

-
-

A paragraph

-
-

This is a more difficult case -With a list item inside the quote

-
    -
  • Alpha
  • -
  • Beta -Etc.
  • -
-
\ No newline at end of file diff --git a/tests/misc/lists5.txt b/tests/misc/lists5.txt deleted file mode 100644 index 566e0f1..0000000 --- a/tests/misc/lists5.txt +++ /dev/null @@ -1,12 +0,0 @@ -> This is a test of a block quote -> With just two lines - -A paragraph - -> This is a more difficult case -> With a list item inside the quote -> -> * Alpha -> * Beta -> Etc. - diff --git a/tests/misc/markup-inside-p.html b/tests/misc/markup-inside-p.html deleted file mode 100644 index 1b6b420..0000000 --- a/tests/misc/markup-inside-p.html +++ /dev/null @@ -1,21 +0,0 @@ -

- -_foo_ - -

- -

-_foo_ -

- -

_foo_

- -

- -_foo_ -

- -

-_foo_ - -

\ No newline at end of file diff --git a/tests/misc/markup-inside-p.txt b/tests/misc/markup-inside-p.txt deleted file mode 100644 index ab7dd0f..0000000 --- a/tests/misc/markup-inside-p.txt +++ /dev/null @@ -1,21 +0,0 @@ -

- -_foo_ - -

- -

-_foo_ -

- -

_foo_

- -

- -_foo_ -

- -

-_foo_ - -

diff --git a/tests/misc/mismatched-tags.html b/tests/misc/mismatched-tags.html deleted file mode 100644 index ec087e1..0000000 --- a/tests/misc/mismatched-tags.html +++ /dev/null @@ -1,11 +0,0 @@ -

Some text

- -
some more text
- -

and a bit more

-

And this output

- -

Compatible with PHP Markdown Extra 1.2.2 and Markdown.pl1.0.2b8:

-

text


- -

Should be in p

\ No newline at end of file diff --git a/tests/misc/mismatched-tags.txt b/tests/misc/mismatched-tags.txt deleted file mode 100644 index 8e6a52f..0000000 --- a/tests/misc/mismatched-tags.txt +++ /dev/null @@ -1,9 +0,0 @@ -

Some text

some more text
- -and a bit more - -

And this output

*Compatible with PHP Markdown Extra 1.2.2 and Markdown.pl1.0.2b8:* - -

text


- -Should be in p diff --git a/tests/misc/missing-link-def.html b/tests/misc/missing-link-def.html deleted file mode 100644 index e04b5eb..0000000 --- a/tests/misc/missing-link-def.html +++ /dev/null @@ -1 +0,0 @@ -

This is a [missing link][empty] and a valid and [missing][again].

\ No newline at end of file diff --git a/tests/misc/missing-link-def.txt b/tests/misc/missing-link-def.txt deleted file mode 100644 index 44bc656..0000000 --- a/tests/misc/missing-link-def.txt +++ /dev/null @@ -1,4 +0,0 @@ -This is a [missing link][empty] and a [valid][link] and [missing][again]. - -[link]: http://example.com - diff --git a/tests/misc/more_comments.html b/tests/misc/more_comments.html deleted file mode 100644 index 97074d5..0000000 --- a/tests/misc/more_comments.html +++ /dev/null @@ -1,7 +0,0 @@ - - -

- -foo - -

- -
- -

foo

-
\ No newline at end of file diff --git a/tests/misc/multiline-comments.txt b/tests/misc/multiline-comments.txt deleted file mode 100644 index 71bc418..0000000 --- a/tests/misc/multiline-comments.txt +++ /dev/null @@ -1,18 +0,0 @@ - - -

- -foo - -

- - -
- -foo - -
diff --git a/tests/misc/nested-lists.html b/tests/misc/nested-lists.html deleted file mode 100644 index bb73784..0000000 --- a/tests/misc/nested-lists.html +++ /dev/null @@ -1,39 +0,0 @@ -
    -
  • -

    item 1

    -

    paragraph 2

    -
  • -
  • -

    item 2

    -
      -
    • item 2-1
    • -
    • -

      item 2-2

      -
        -
      • item 2-2-1
      • -
      -
    • -
    • -

      item 2-3

      -
        -
      • item 2-3-1
      • -
      -
    • -
    -
  • -
  • -

    item 3

    -
  • -
-

plain text

-
    -
  • item 1
      -
    • item 1-1
    • -
    • item 1-2
        -
      • item 1-2-1
      • -
      -
    • -
    -
  • -
  • item 2
  • -
\ No newline at end of file diff --git a/tests/misc/nested-lists.txt b/tests/misc/nested-lists.txt deleted file mode 100644 index 38aae15..0000000 --- a/tests/misc/nested-lists.txt +++ /dev/null @@ -1,24 +0,0 @@ -* item 1 - - paragraph 2 - -* item 2 - - * item 2-1 - * item 2-2 - - * item 2-2-1 - - * item 2-3 - - * item 2-3-1 - -* item 3 - -plain text - -* item 1 - * item 1-1 - * item 1-2 - * item 1-2-1 -* item 2 diff --git a/tests/misc/nested-patterns.html b/tests/misc/nested-patterns.html deleted file mode 100644 index b90d46d..0000000 --- a/tests/misc/nested-patterns.html +++ /dev/null @@ -1,7 +0,0 @@ -

link -link -link -link -link -link -link

\ No newline at end of file diff --git a/tests/misc/nested-patterns.txt b/tests/misc/nested-patterns.txt deleted file mode 100644 index 3f5dc3e..0000000 --- a/tests/misc/nested-patterns.txt +++ /dev/null @@ -1,7 +0,0 @@ -___[link](http://www.freewisdom.org)___ -***[link](http://www.freewisdom.org)*** -**[*link*](http://www.freewisdom.org)** -__[_link_](http://www.freewisdom.org)__ -__[*link*](http://www.freewisdom.org)__ -**[_link_](http://www.freewisdom.org)** -[***link***](http://www.freewisdom.org) diff --git a/tests/misc/normalize.html b/tests/misc/normalize.html deleted file mode 100644 index 8d05375..0000000 --- a/tests/misc/normalize.html +++ /dev/null @@ -1 +0,0 @@ -

Link

\ No newline at end of file diff --git a/tests/misc/normalize.txt b/tests/misc/normalize.txt deleted file mode 100644 index fe0cf17..0000000 --- a/tests/misc/normalize.txt +++ /dev/null @@ -1,2 +0,0 @@ - -[Link](http://www.stuff.com/q?x=1&y=2<>) diff --git a/tests/misc/numeric-entity.html b/tests/misc/numeric-entity.html deleted file mode 100644 index 3ad3b7a..0000000 --- a/tests/misc/numeric-entity.html +++ /dev/null @@ -1,2 +0,0 @@ -

user@gmail.com

-

This is an entity: ê

\ No newline at end of file diff --git a/tests/misc/numeric-entity.txt b/tests/misc/numeric-entity.txt deleted file mode 100644 index fd2052b..0000000 --- a/tests/misc/numeric-entity.txt +++ /dev/null @@ -1,4 +0,0 @@ - - - -This is an entity: ê diff --git a/tests/misc/para-with-hr.html b/tests/misc/para-with-hr.html deleted file mode 100644 index 8569fec..0000000 --- a/tests/misc/para-with-hr.html +++ /dev/null @@ -1,3 +0,0 @@ -

Here is a paragraph, followed by a horizontal rule.

-
-

Followed by another paragraph.

\ No newline at end of file diff --git a/tests/misc/para-with-hr.txt b/tests/misc/para-with-hr.txt deleted file mode 100644 index 20735fb..0000000 --- a/tests/misc/para-with-hr.txt +++ /dev/null @@ -1,4 +0,0 @@ -Here is a paragraph, followed by a horizontal rule. -*** -Followed by another paragraph. - diff --git a/tests/misc/php.html b/tests/misc/php.html deleted file mode 100644 index 8cd4ed5..0000000 --- a/tests/misc/php.html +++ /dev/null @@ -1,11 +0,0 @@ - - -

This should have a p tag

- - -
This shouldn't
- - - -

<?php echo "not_block_level";?>

\ No newline at end of file diff --git a/tests/misc/php.txt b/tests/misc/php.txt deleted file mode 100644 index ca5be45..0000000 --- a/tests/misc/php.txt +++ /dev/null @@ -1,13 +0,0 @@ - - -This should have a p tag - - - -
This shouldn't
- - - - - diff --git a/tests/misc/pre.html b/tests/misc/pre.html deleted file mode 100644 index a44ae12..0000000 --- a/tests/misc/pre.html +++ /dev/null @@ -1,13 +0,0 @@ -
-
-aaa
-
-bbb
-
- -
-* and this is pre-formatted content
-* and it should be printed just like this
-* and not formatted as a list
-
-
\ No newline at end of file diff --git a/tests/misc/pre.txt b/tests/misc/pre.txt deleted file mode 100644 index 31243b5..0000000 --- a/tests/misc/pre.txt +++ /dev/null @@ -1,14 +0,0 @@ -
-
-aaa
-
-bbb
-
- -
-* and this is pre-formatted content
-* and it should be printed just like this
-* and not formatted as a list
-
-
- diff --git a/tests/misc/russian.html b/tests/misc/russian.html deleted file mode 100644 index 57c9688..0000000 --- a/tests/misc/russian.html +++ /dev/null @@ -1,6 +0,0 @@ -

Недвард «Нед» Фландерс

-

Недвард «Нед» Фландерс (Nedward «Ned» Flanders) — вымышленный персонаж мультсериала «[Симпсоны][]», озвученный Гарри Ширером. Он и его семья живут по соседству от семьи Симпсонов. Набожный христианин, Нед является одним из столпов морали Спрингфилда. В эпизоде «Alone Again, Natura-Diddily» он овдовел, его жена Мод погибла в результате несчастного случая.

-

Нед был одним из первых персонажей в мультсериале, который не был членом семьи Симпсонов. Начиная с первых серий, он регулярно появляется в «Симпсонах». Считается, что Нед Фландерс был назван в честь улицы Northeast Flanders St. в Портленде, Орегон, родном городе создателя мультсериала Мэтта Грейнинга]]. Надпись на указателе улицы NE Flanders St. хулиганы часто исправляли на NED Flanders St.

-

Биография

-

Нед Фландерс родился в Нью-Йорке, его родители были битниками. Его отец в точности похож на взрослого Неда, только он носил козлиную бородку. Их отказ от воспитания Неда и то, что они, в общем-то, были плохими родителями («мы ничего в этом не понимаем и не знаем как начать») привело к тому, что Нед превратился в ужасного сорванца. В конце концов они согласились на экспериментальную восьмимесячную шлепологическую терапию Миннесотского Университета (воспоминания Неда в эпизоде «Hurricane Neddy»), которая научила его подавлять чувство злости. Побочным эфектом терапии стало то, что Нед стал ненавидеть своих родителей (это одна из двух вещей которые ненавидит Фландерс, вторая — отделения почты, чьи длинные очереди, суета и угрюмый персонал раздражают его).

-

У Неда есть странная привычка добавлять «дидли», «дадли» и другие бессмысленные слова в свои фразы при разговоре, например: «Hi-diddly-ho, neighbor-ino» («Приветик, соседушка»). Это результат сублимации его злости, вызванной сдерживанием гнева, который не имеет никакого другого выхода.

\ No newline at end of file diff --git a/tests/misc/russian.txt b/tests/misc/russian.txt deleted file mode 100644 index a742065..0000000 --- a/tests/misc/russian.txt +++ /dev/null @@ -1,15 +0,0 @@ -Недвард «Нед» Фландерс -====================== - - -**Недвард «Нед» Фландерс** (Nedward «Ned» Flanders) — вымышленный персонаж мультсериала «[Симпсоны][]», озвученный Гарри Ширером. Он и его семья живут по соседству от семьи Симпсонов. Набожный христианин, Нед является одним из столпов морали Спрингфилда. В эпизоде «Alone Again, Natura-Diddily» он овдовел, его жена Мод погибла в результате несчастного случая. - -Нед был одним из первых персонажей в мультсериале, который не был членом семьи Симпсонов. Начиная с первых серий, он регулярно появляется в «Симпсонах». Считается, что Нед Фландерс был назван в честь улицы *Northeast Flanders St.* в [Портленде](http://www.portland.gov), Орегон, родном городе создателя мультсериала Мэтта Грейнинга]]. Надпись на указателе улицы *NE Flanders St.* хулиганы часто исправляли на _NED Flanders St._ - -## Биография - -Нед Фландерс родился в Нью-Йорке, его родители были битниками. Его отец в точности похож на взрослого Неда, только он носил козлиную бородку. Их отказ от воспитания Неда и то, что они, в общем-то, были плохими родителями («мы ничего в этом не понимаем и не знаем как начать») привело к тому, что Нед превратился в ужасного сорванца. В конце концов они согласились на экспериментальную восьмимесячную шлепологическую терапию Миннесотского Университета (воспоминания Неда в эпизоде «Hurricane Neddy»), которая научила его подавлять чувство злости. Побочным эфектом терапии стало то, что Нед стал ненавидеть своих родителей (это одна из двух вещей которые ненавидит Фландерс, вторая — отделения почты, чьи длинные очереди, суета и угрюмый персонал раздражают его). - -У Неда есть странная привычка добавлять «дидли», «дадли» и другие бессмысленные слова в свои фразы при разговоре, например: «Hi-diddly-ho, neighbor-ino» («Приветик, соседушка»). Это результат сублимации его злости, вызванной сдерживанием гнева, который не имеет никакого другого выхода. - - diff --git a/tests/misc/some-test.html b/tests/misc/some-test.html deleted file mode 100644 index a36d1ee..0000000 --- a/tests/misc/some-test.html +++ /dev/null @@ -1,66 +0,0 @@ -
-
    -
  • -

    as if

    -
  • -
  • -

    as if2

    -
  • -
-
-
    -
  • -

    as if

    -
  • -
  • -

    as if2

    -
  • -
-
-
    -
  • as if - non_code
  • -
  • as if2
  • -
-

Markdown

-
    -
  • Python - is ok
      -
    • Therefore i am
    • -
    -
  • -
  • -

    Perl sucks - big time

    -
      -
    • But that's -ok
    • -
    -
  • -
  • -

    Python is -ok - Or not?

    -
  • -
-

Here is a normal paragraph

-
    -
  1. Another list -with a bunch of items
  2. -
  3. -

    Mostly fruits

    -
      -
    1. Apple
    2. -
    3. Pare
    4. -
    -
  4. -
-

asdfasdfasd

-
# This is a code example
-import stuff
-
-Another code example
-* Lists and similar stuff
-
-> Should be ignored
-
\ No newline at end of file diff --git a/tests/misc/some-test.txt b/tests/misc/some-test.txt deleted file mode 100644 index 0708817..0000000 --- a/tests/misc/some-test.txt +++ /dev/null @@ -1,57 +0,0 @@ ----------------------- - -* as if - -* as if2 - ----------------------- - -* as if - -* as if2 - ----------------------- - -* as if - non_code -* as if2 - - - - -Markdown - -* Python - is ok - * Therefore i am - -* Perl sucks - big time - * But that's - ok - -* Python is -ok - Or not? - -Here is a normal paragraph - -1. Another list -with a bunch of items -2. Mostly fruits - - - - 3. Apple - 4. Pare - -asdfasdfasd - - - # This is a code example - import stuff - - Another code example - * Lists and similar stuff - - > Should be ignored diff --git a/tests/misc/span.html b/tests/misc/span.html deleted file mode 100644 index bafcf0f..0000000 --- a/tests/misc/span.html +++ /dev/null @@ -1,6 +0,0 @@ -

Foo bar Baz

-
*foo*
- -
Foo *bar* Baz
- -

Foo bar Baz

\ No newline at end of file diff --git a/tests/misc/span.txt b/tests/misc/span.txt deleted file mode 100644 index 62bcf9b..0000000 --- a/tests/misc/span.txt +++ /dev/null @@ -1,10 +0,0 @@ - - Foo *bar* Baz - -
*foo*
- -
Foo *bar* Baz
- - Foo *bar* Baz - - diff --git a/tests/misc/strong-with-underscores.html b/tests/misc/strong-with-underscores.html deleted file mode 100644 index 08e6744..0000000 --- a/tests/misc/strong-with-underscores.html +++ /dev/null @@ -1 +0,0 @@ -

this_is_strong

\ No newline at end of file diff --git a/tests/misc/strong-with-underscores.txt b/tests/misc/strong-with-underscores.txt deleted file mode 100644 index 1a3544f..0000000 --- a/tests/misc/strong-with-underscores.txt +++ /dev/null @@ -1 +0,0 @@ -__this_is_strong__ diff --git a/tests/misc/stronintags.html b/tests/misc/stronintags.html deleted file mode 100644 index cf18bd0..0000000 --- a/tests/misc/stronintags.html +++ /dev/null @@ -1,4 +0,0 @@ -

this is a test

-

this is a second test

-

reference [test][] -reference [test][]

\ No newline at end of file diff --git a/tests/misc/stronintags.txt b/tests/misc/stronintags.txt deleted file mode 100644 index 01c118f..0000000 --- a/tests/misc/stronintags.txt +++ /dev/null @@ -1,8 +0,0 @@ -this is a [**test**](http://example.com/) - -this is a second **[test](http://example.com)** - -reference **[test][]** -reference [**test**][] - - diff --git a/tests/misc/tabs-in-lists.html b/tests/misc/tabs-in-lists.html deleted file mode 100644 index fdb7cb6..0000000 --- a/tests/misc/tabs-in-lists.html +++ /dev/null @@ -1,42 +0,0 @@ -

First a list with a tabbed line

-
    -
  • -

    A

    -
  • -
  • -

    B

    -
  • -
-

Just a blank line:

-
    -
  • -

    A

    -
  • -
  • -

    B

    -
  • -
-

Now a list with 4 spaces and some text:

-
    -
  • A - abcdef
  • -
  • B
  • -
-

Now with a tab and an extra space:

-
    -
  • -

    A

    -
  • -
  • -

    B

    -
  • -
-

Now a list with 4 spaces:

-
    -
  • -

    A

    -
  • -
  • -

    B

    -
  • -
\ No newline at end of file diff --git a/tests/misc/tabs-in-lists.txt b/tests/misc/tabs-in-lists.txt deleted file mode 100644 index 05fde23..0000000 --- a/tests/misc/tabs-in-lists.txt +++ /dev/null @@ -1,32 +0,0 @@ -First a list with a tabbed line - -* A - -* B - -Just a blank line: - -* A - -* B - - -Now a list with 4 spaces and some text: - -* A - abcdef -* B - - -Now with a tab and an extra space: - -* A - -* B - -Now a list with 4 spaces: - -* A - -* B - diff --git a/tests/misc/two-spaces.html b/tests/misc/two-spaces.html deleted file mode 100644 index 102d1db..0000000 --- a/tests/misc/two-spaces.html +++ /dev/null @@ -1,21 +0,0 @@ -

This line has two spaces at the end
-but this one has none -but this line has three
-and this is the second from last line -in this test message

-
    -
  • This list item has two spaces.
    -
  • -
  • -

    This has none. - This line has three.
    - This line has none. - And this line two.
    -

    -

    This line has none.

    -
  • -
  • -

    This line has none.

    -
  • -
-

And this is the end.

\ No newline at end of file diff --git a/tests/misc/two-spaces.txt b/tests/misc/two-spaces.txt deleted file mode 100644 index 61c19f7..0000000 --- a/tests/misc/two-spaces.txt +++ /dev/null @@ -1,17 +0,0 @@ -This line has two spaces at the end -but this one has none -but this line has three -and this is the second from last line -in this test message - -* This list item has two spaces. -* This has none. - This line has three. - This line has none. - And this line two. - - This line has none. - -* This line has none. - -And this is the end. diff --git a/tests/misc/uche.html b/tests/misc/uche.html deleted file mode 100644 index e62329d..0000000 --- a/tests/misc/uche.html +++ /dev/null @@ -1,3 +0,0 @@ -

asif

-

-

text

\ No newline at end of file diff --git a/tests/misc/uche.txt b/tests/misc/uche.txt deleted file mode 100644 index a3dda1a..0000000 --- a/tests/misc/uche.txt +++ /dev/null @@ -1,7 +0,0 @@ -![asif](http://fourthought.com/images/ftlogo.png "Fourthought logo") - -[![{@style=float: left; margin: 10px; border: -none;}](http://fourthought.com/images/ftlogo.png "Fourthought -logo")](http://fourthought.com/) - -[![text](x)](http://link.com/) diff --git a/tests/misc/underscores.html b/tests/misc/underscores.html deleted file mode 100644 index 54bd9f9..0000000 --- a/tests/misc/underscores.html +++ /dev/null @@ -1,6 +0,0 @@ -

THIS_SHOULD_STAY_AS_IS

-

Here is some emphasis, ok?

-

Ok, at least this should work.

-

THISSHOULDSTAY

-

Here is some strong stuff.

-

THISSHOULDSTAY?

\ No newline at end of file diff --git a/tests/misc/underscores.txt b/tests/misc/underscores.txt deleted file mode 100644 index 3c7f4bd..0000000 --- a/tests/misc/underscores.txt +++ /dev/null @@ -1,11 +0,0 @@ -THIS_SHOULD_STAY_AS_IS - -Here is some _emphasis_, ok? - -Ok, at least _this_ should work. - -THIS__SHOULD__STAY - -Here is some __strong__ stuff. - -THIS___SHOULD___STAY? diff --git a/tests/misc/url_spaces.html b/tests/misc/url_spaces.html deleted file mode 100644 index ebacb75..0000000 --- a/tests/misc/url_spaces.html +++ /dev/null @@ -1,2 +0,0 @@ -

Dawn of War

-

Dawn of War

\ No newline at end of file diff --git a/tests/misc/url_spaces.txt b/tests/misc/url_spaces.txt deleted file mode 100644 index 3d2a82d..0000000 --- a/tests/misc/url_spaces.txt +++ /dev/null @@ -1,4 +0,0 @@ -[Dawn of War](http://wikipedia.org/wiki/Dawn of War) - - -[Dawn of War](http://wikipedia.org/wiki/Dawn of War "Dawn of War") diff --git a/tests/plugins.py b/tests/plugins.py deleted file mode 100644 index d0cb7f8..0000000 --- a/tests/plugins.py +++ /dev/null @@ -1,113 +0,0 @@ -import traceback -from util import MdSyntaxError -from nose.plugins import Plugin -from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin - -class MdSyntaxErrorPlugin(ErrorClassPlugin): - """ Add MdSyntaxError and ensure proper formatting. """ - mdsyntax = ErrorClass(MdSyntaxError, label='MdSyntaxError', isfailure=True) - enabled = True - - def configure(self, options, conf): - self.conf = conf - - def addError(self, test, err): - """ Ensure other plugins see the error by returning nothing here. """ - pass - - def formatError(self, test, err): - """ Remove unnessecary and unhelpful traceback from error report. """ - et, ev, tb = err - if et.__name__ == 'MdSyntaxError': - return et, ev, '' - return err - - -def escape(html): - """ Escape HTML for display as source within HTML. """ - html = html.replace('&', '&') - html = html.replace('<', '<') - html = html.replace('>', '>') - return html - - -class HtmlOutput(Plugin): - """Output test results as ugly, unstyled html. """ - - name = 'html-output' - score = 2 # run late - enabled = True - - def __init__(self): - super(HtmlOutput, self).__init__() - self.html = [ '', - 'Test output', - '' ] - - def configure(self, options, conf): - self.conf = conf - - def addSuccess(self, test): - self.html.append('ok') - - def addError(self, test, err): - err = self.formatErr(err) - self.html.append('ERROR') - self.html.append('
%s
' % escape(err)) - - def addFailure(self, test, err): - err = self.formatErr(err) - self.html.append('FAIL') - self.html.append('
%s
' % escape(err)) - - def finalize(self, result): - self.html.append('
') - self.html.append("Ran %d test%s" % - (result.testsRun, result.testsRun != 1 and "s" -or "")) - self.html.append('
') - self.html.append('
') - if not result.wasSuccessful(): - self.html.extend(['FAILED (', - 'failures=%d ' % len(result.failures), - 'errors=%d' % len(result.errors)]) - for cls in result.errorClasses.keys(): - storage, label, isfail = result.errorClasses[cls] - if isfail: - self.html.append(' %ss=%d' % (label, len(storage))) - self.html.append(')') - else: - self.html.append('OK') - self.html.append('
') - f = open('tmp/test-output.html', 'w') - for l in self.html: - f.write(l) - f.close() - - def formatErr(self, err): - exctype, value, tb = err - return ''.join(traceback.format_exception(exctype, value, tb)) - - def startContext(self, ctx): - try: - n = ctx.__name__ - except AttributeError: - n = str(ctx).replace('<', '').replace('>', '') - self.html.extend(['
', '', n, '']) - try: - path = ctx.__file__.replace('.pyc', '.py') - self.html.extend(['
', path, '
']) - except AttributeError: - pass - - def stopContext(self, ctx): - self.html.append('
') - - def startTest(self, test): - self.html.extend([ '
', - test.shortDescription() or str(test), - '' ]) - - def stopTest(self, test): - self.html.append('
') - diff --git a/tests/safe_mode/inline-html-advanced.html b/tests/safe_mode/inline-html-advanced.html deleted file mode 100644 index e9dd2ec..0000000 --- a/tests/safe_mode/inline-html-advanced.html +++ /dev/null @@ -1,11 +0,0 @@ -

Simple block on one line:

-

<div>foo</div>

-

And nested without indentation:

-

<div> -<div> -<div> -foo -</div> -</div> -<div>bar</div> -</div>

\ No newline at end of file diff --git a/tests/safe_mode/inline-html-advanced.txt b/tests/safe_mode/inline-html-advanced.txt deleted file mode 100644 index 9d71ddc..0000000 --- a/tests/safe_mode/inline-html-advanced.txt +++ /dev/null @@ -1,14 +0,0 @@ -Simple block on one line: - -
foo
- -And nested without indentation: - -
-
-
-foo -
-
-
bar
-
diff --git a/tests/safe_mode/inline-html-comments.html b/tests/safe_mode/inline-html-comments.html deleted file mode 100644 index 0f1e417..0000000 --- a/tests/safe_mode/inline-html-comments.html +++ /dev/null @@ -1,8 +0,0 @@ -

Paragraph one.

-

<!-- This is a simple comment -->

-

<!-- - This is another comment. --->

-

Paragraph two.

-

<!-- one comment block -- -- with two comments -->

-

The end.

\ No newline at end of file diff --git a/tests/safe_mode/inline-html-comments.txt b/tests/safe_mode/inline-html-comments.txt deleted file mode 100644 index 41d830d..0000000 --- a/tests/safe_mode/inline-html-comments.txt +++ /dev/null @@ -1,13 +0,0 @@ -Paragraph one. - - - - - -Paragraph two. - - - -The end. diff --git a/tests/safe_mode/inline-html-simple.html b/tests/safe_mode/inline-html-simple.html deleted file mode 100644 index ad19a77..0000000 --- a/tests/safe_mode/inline-html-simple.html +++ /dev/null @@ -1,45 +0,0 @@ -

Here's a simple block:

-

<div> - foo -</div>

-

This should be a code block, though:

-
<div>
-    foo
-</div>
-
-

As should this:

-
<div>foo</div>
-
-

Now, nested:

-

<div> - <div> - <div> - foo - </div> - </div> -</div>

-

This should just be an HTML comment:

-

<!-- Comment -->

-

Multiline:

-

<!-- -Blah -Blah --->

-

Code block:

-
<!-- Comment -->
-
-

Just plain comment, with trailing spaces on the line:

-

<!-- foo -->

-

Code:

-
<hr />
-
-

Hr's:

-

<hr>

-

<hr/>

-

<hr />

-

<hr>

-

<hr/>

-

<hr />

-

<hr class="foo" id="bar" />

-

<hr class="foo" id="bar"/>

-

<hr class="foo" id="bar" >

\ No newline at end of file diff --git a/tests/safe_mode/inline-html-simple.txt b/tests/safe_mode/inline-html-simple.txt deleted file mode 100644 index 14aa2dc..0000000 --- a/tests/safe_mode/inline-html-simple.txt +++ /dev/null @@ -1,69 +0,0 @@ -Here's a simple block: - -
- foo -
- -This should be a code block, though: - -
- foo -
- -As should this: - -
foo
- -Now, nested: - -
-
-
- foo -
-
-
- -This should just be an HTML comment: - - - -Multiline: - - - -Code block: - - - -Just plain comment, with trailing spaces on the line: - - - -Code: - -
- -Hr's: - -
- -
- -
- -
- -
- -
- -
- -
- -
- diff --git a/tests/safe_mode/script_tags.html b/tests/safe_mode/script_tags.html deleted file mode 100644 index df63ffc..0000000 --- a/tests/safe_mode/script_tags.html +++ /dev/null @@ -1,28 +0,0 @@ -

This should be stripped/escaped in safe_mode.

-

<script> -alert("Hello world!") -</script>

-

With blank lines.

-

<script> - -alert("Hello world!") - -</script>

-

Now with some weirdness

-

<script <!-- -alert("Hello world!") -</script <> `

-

Try another way.

-

<script <!-- -alert("Hello world!") -</script <> - -This time with blank lines. - -<script <!-- - -alert("Hello world!") - -</script <> - -

\ No newline at end of file diff --git a/tests/safe_mode/script_tags.txt b/tests/safe_mode/script_tags.txt deleted file mode 100644 index 44041c2..0000000 --- a/tests/safe_mode/script_tags.txt +++ /dev/null @@ -1,33 +0,0 @@ -This should be stripped/escaped in safe_mode. - - - -With blank lines. - - - -Now with some weirdness - -`` - -This time with blank lines. - -