aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Yunusov <nedrlab@gmail.com>2008-07-14 16:17:33 +0500
committerArtem Yunusov <nedrlab@gmail.com>2008-07-14 16:17:33 +0500
commita316ac49a6934221b24ec58a6a7dc4c3b30ae1e8 (patch)
treedfbbdef295252fe9fe07ed888ed0a3b79c83b8d3
parent54a6d381a1a92210f3e619f7b2910b38a0568f9c (diff)
downloadmarkdown-a316ac49a6934221b24ec58a6a7dc4c3b30ae1e8.tar.gz
markdown-a316ac49a6934221b24ec58a6a7dc4c3b30ae1e8.tar.bz2
markdown-a316ac49a6934221b24ec58a6a7dc4c3b30ae1e8.zip
A lot of bug fixes. Handlig attributes added, new hr processing. Reformatted test suite for ElementTree output.
-rw-r--r--markdown.py181
-rw-r--r--tests/markdown-test/amps-and-angle-encoding.html30
-rw-r--r--tests/markdown-test/auto-links.html30
-rw-r--r--tests/markdown-test/backlash-escapes.html67
-rw-r--r--tests/markdown-test/blockquotes-with-dode-blocks.html21
-rw-r--r--tests/markdown-test/hard-wrapped.html15
-rw-r--r--tests/markdown-test/horizontal-rules.html72
-rw-r--r--tests/markdown-test/inline-html-advanced.html17
-rw-r--r--tests/markdown-test/inline-html-comments.html23
-rw-r--r--tests/markdown-test/inline-html-simple.html101
-rw-r--r--tests/markdown-test/links-inline.html22
-rw-r--r--tests/markdown-test/links-reference.html32
-rw-r--r--tests/markdown-test/literal-quotes.html9
-rw-r--r--tests/markdown-test/markdown-documentation-basics.html308
-rw-r--r--tests/markdown-test/markdown-syntax.html1280
-rw-r--r--tests/markdown-test/nested-blockquotes.html14
-rw-r--r--tests/markdown-test/ordered-and-unordered-list.html341
-rw-r--r--tests/markdown-test/strong-and-em-together.html23
-rw-r--r--tests/markdown-test/tabs.html46
-rw-r--r--tests/markdown-test/tidyness.html22
-rw-r--r--tests/misc/CRLF_line_ends.html7
-rw-r--r--tests/misc/adjacent-headers.html7
-rw-r--r--tests/misc/amp-in-url.html8
-rw-r--r--tests/misc/ampersand.html9
-rw-r--r--tests/misc/arabic.html44
-rw-r--r--tests/misc/attributes2.html16
-rw-r--r--tests/misc/bidi.html82
-rw-r--r--tests/misc/blank-block-quote.html10
-rw-r--r--tests/misc/blockquote-hr.html31
-rw-r--r--tests/misc/blockquote.html44
-rw-r--r--tests/misc/bold_links.html6
-rw-r--r--tests/misc/br.html17
-rw-r--r--tests/misc/bracket_re.html119
-rw-r--r--tests/misc/code-first-line.html6
-rw-r--r--tests/misc/comments.html15
-rw-r--r--tests/misc/div.html12
-rw-r--r--tests/misc/email.html5
-rw-r--r--tests/misc/funky-list.html34
-rw-r--r--tests/misc/h1.html8
-rw-r--r--tests/misc/hash.html23
-rw-r--r--tests/misc/headers.html13
-rw-r--r--tests/misc/hline.html7
-rw-r--r--tests/misc/html.html14
-rw-r--r--tests/misc/image-2.html15
-rw-r--r--tests/misc/image.html6
-rw-r--r--tests/misc/image_in_links.html7
-rw-r--r--tests/misc/inside_html.html6
-rw-r--r--tests/misc/japanese.html31
-rw-r--r--tests/misc/lazy-block-quote.html13
-rw-r--r--tests/misc/lists.html82
-rw-r--r--tests/misc/lists2.html13
-rw-r--r--tests/misc/lists3.html13
-rw-r--r--tests/misc/lists4.html25
-rw-r--r--tests/misc/lists5.html31
-rw-r--r--tests/misc/markup-inside-p.html26
-rw-r--r--tests/misc/mismatched-tags.html8
-rw-r--r--tests/misc/more_comments.html8
-rw-r--r--tests/misc/multi-line-tags.html12
-rw-r--r--tests/misc/multi-paragraph-block-quote.html16
-rw-r--r--tests/misc/multi-test.html44
-rw-r--r--tests/misc/multiline-comments.html22
-rw-r--r--tests/misc/normalize.html8
-rw-r--r--tests/misc/numeric-entity.html9
-rw-r--r--tests/misc/php.html17
-rw-r--r--tests/misc/pre.html13
-rw-r--r--tests/misc/russian.html15
-rw-r--r--tests/misc/some-test.html126
-rw-r--r--tests/misc/span.html15
-rw-r--r--tests/misc/strong-with-underscores.html5
-rw-r--r--tests/misc/stronintags.html14
-rw-r--r--tests/misc/tabs-in-lists.html91
-rw-r--r--tests/misc/two-spaces.html43
-rw-r--r--tests/misc/uche.html17
-rw-r--r--tests/misc/underscores.html23
-rw-r--r--tests/misc/url_spaces.html11
-rw-r--r--tests/safe_mode/inline-html-advanced.html13
-rw-r--r--tests/safe_mode/inline-html-comments.html20
-rw-r--r--tests/safe_mode/inline-html-simple.html97
-rw-r--r--tests/safe_mode/script_tags.html34
-rw-r--r--tests/safe_mode/unsafe_urls.html45
80 files changed, 1871 insertions, 2314 deletions
diff --git a/markdown.py b/markdown.py
index f3f2481..032e084 100644
--- a/markdown.py
+++ b/markdown.py
@@ -62,31 +62,25 @@ def message(level, text):
def isstr(s):
return isinstance(s, unicode) or isinstance(s, str)
-'''try:
- # running with lxml.etree
- from lxml import etree
+try:
+ # Python 2.5+
+ import xml.etree.cElementTree as etree
except ImportError:
try:
# Python 2.5+
- import xml.etree.cElementTree as etree
+ import xml.etree.ElementTree as etree
except ImportError:
try:
- # Python 2.5+
- import xml.etree.ElementTree as etree
+ # normal cElementTree install
+ import cElementTree as etree
except ImportError:
try:
- # normal cElementTree install
- import cElementTree as etree
+ # normal ElementTree install
+ import elementtree.ElementTree as etree
except ImportError:
- try:
- # normal ElementTree install
- import elementtree.ElementTree as etree
- except ImportError:
- message(CRITICAL,
- "Failed to import ElementTree from any known place")
- sys.exit(1)'''
-
-import xml.etree.cElementTree as etree
+ message(CRITICAL,
+ "Failed to import ElementTree from any known place")
+ sys.exit(1)
def indentETree(elem, level=0):
@@ -110,7 +104,7 @@ def indentETree(elem, level=0):
TAB_LENGTH = 4 # expand tabs to this many spaces
ENABLE_ATTRIBUTES = True # @id = xyz -> <... id="xyz">
-SMART_EMPHASIS = 1 # this_or_that does not become this<i>or</i>that
+SMART_EMPHASIS = True # this_or_that does not become this<i>or</i>that
HTML_REMOVED_TEXT = "[HTML_REMOVED]" # text used instead of HTML in safe mode
RTL_BIDI_RANGES = ( (u'\u0590', u'\u07FF'),
@@ -184,6 +178,13 @@ def codepoint2name(code):
else:
return "%s#%d;" % (AND_SUBSTITUTE, code)
+def handleAttributes(text, parent):
+
+ def attributeCallback(match):
+ parent.set(match.group(1), match.group(2))
+
+ return RE.regExp['attr'].sub(attributeCallback, text)
+
"""
======================================================================
@@ -395,24 +396,27 @@ class LinePreprocessor(Preprocessor):
for i in range(len(lines)):
prefix = ''
m = self.blockquote_re.search(lines[i])
- if m : prefix = m.group(0)
+ if m:
+ prefix = m.group(0)
if self._isLine(lines[i][len(prefix):]):
- lines[i] = prefix + self.stash.store("<hr />", safe=True)
+ #lines[i] = prefix + self.stash.store("<hr />", safe=True)
+ lines[i] = prefix + "___"
return lines
def _isLine(self, block):
"""Determine if a block should be replaced with an <HR>"""
- if block.startswith(" "): return 0 # a code block
+ if block.startswith(" "):
+ return False # a code block
text = "".join([x for x in block if not x.isspace()])
if len(text) <= 2:
- return 0
+ return False
for pattern in ['isline1', 'isline2', 'isline3']:
m = RE.regExp[pattern].match(text)
if (m and m.group(1)):
- return 1
+ return True
else:
- return 0
+ return False
LINE_PREPROCESSOR = LinePreprocessor()
@@ -510,7 +514,7 @@ STRONG_EM_RE = r'\*\*\*(.*?|[^***]+?)\*\*\*' # ***strong***
if SMART_EMPHASIS:
- EMPHASIS_2_RE = r'(?<!\S)_(\S[^_]*)_' # _emphasis_
+ EMPHASIS_2_RE = r'(?<!\S)_(\S[^_]+)_' # _emphasis_
else:
EMPHASIS_2_RE = r'_([^_]*)_' # _emphasis_
@@ -644,14 +648,13 @@ class LinkPattern (Pattern):
parts = m.group(9).split('"')
# We should now have [], [href], or [href, title]
if parts:
-
el.set("href", self.sanatize_url(parts[0].strip()))
else:
el.set("href", "")
if len(parts) > 1:
# we also got a title
- title = '"' + '"'.join(parts[1:]).strip()
+ title = ('"' + '"'.join(parts[1:]).strip())[1:-1]
#title = dequote(title) #.replace('"', "&quot;")
el.set("title", title)
return el
@@ -690,6 +693,7 @@ class LinkPattern (Pattern):
class ImagePattern(LinkPattern):
""" Return a NanoDom img Element from the given match. """
+
def handleMatch(self, m):
el = etree.Element("img")
src_parts = m.group(9).split()
@@ -699,27 +703,12 @@ class ImagePattern(LinkPattern):
el.set('src', "")
if len(src_parts) > 1:
el.set('title', dequote(" ".join(src_parts[1:])))
-
- # Need to be reimplemented
- '''if ENABLE_ATTRIBUTES:
- el.text = m.group(2)
- truealt = text.value
- el.childNodes.remove(text)
-
- self.attrRegExp.sub(self.attributeCallback, self.value)
-
-
- text = doc.createTextNode(m.group(2))
- el.appendChild(text)
- text.handleAttributes()
- truealt = text.value
- el.childNodes.remove(text)
-
-
+
+ if ENABLE_ATTRIBUTES:
+ truealt = handleAttributes(m.group(2), el)
else:
- truealt = m.group(2)'''
+ truealt = m.group(2)
- truealt = m.group(2)
el.set('alt', truealt)
return el
@@ -737,6 +726,7 @@ class ReferencePattern(LinkPattern):
if not self.references.has_key(id): # ignore undefined refs
return None
href, title = self.references[id]
+
text = m.group(2)
return self.makeTag(href, title, text)
@@ -746,6 +736,7 @@ class ReferencePattern(LinkPattern):
el.set('href', self.sanatize_url(href))
if title:
el.set('title', title)
+
el.text = text
return el
@@ -1130,6 +1121,7 @@ class CorePatterns:
re.DOTALL)
self.regExp['containsline'] = re.compile(r'^([-]*)$|^([=]*)$', re.M)
+ self.regExp['attr'] = re.compile("\{@([^\}]*)=([^\}]*)}") # {@id=123}
RE = CorePatterns()
@@ -1389,7 +1381,13 @@ class Markdown:
if len(paragraph) and paragraph[0].startswith('#'):
self._processHeader(parent_elem, paragraph)
+
+ elif len(paragraph) and \
+ RE.regExp["isline3"].match(paragraph[0]):
+ self._processHR(parent_elem)
+ lines = paragraph[1:] + lines
+
elif paragraph:
self._processParagraph(parent_elem, paragraph,
inList, looseList)
@@ -1397,7 +1395,9 @@ class Markdown:
if lines and not lines[0].strip():
lines = lines[1:] # skip the first (blank) line
-
+ def _processHR(self, parent_elem):
+ hr = etree.SubElement(parent_elem, "hr")
+
def _processHeader(self, parent_elem, paragraph):
m = RE.regExp['header'].match(paragraph[0])
if m:
@@ -1410,10 +1410,6 @@ class Markdown:
def _processParagraph(self, parent_elem, paragraph, inList, looseList):
- #list = self._handleInline("\n".join(paragraph))
-
-
-
if ( parent_elem.tag == 'li'
and not (looseList or parent_elem.getchildren())):
@@ -1426,13 +1422,21 @@ class Markdown:
# Otherwise make a "p" element
el = etree.SubElement(parent_elem, "p")
- #el.appendChild(self.doc.createTextNode("\n".join(paragraph), "inline"))
- inline = etree.SubElement(el, "inline")
- inline.text = "\n".join(paragraph)
+ dump = []
- #for item in list:
- #el.appendChild(item)
-
+ # Searching for hr
+ for line in paragraph:
+ if RE.regExp["isline3"].match(line):
+ inline = etree.SubElement(el, "inline")
+ inline.text = "\n".join(dump)
+ etree.SubElement(el, "hr")
+ dump.clear()
+ else:
+ dump.append(line)
+ if dump:
+ text = "\n".join(dump)
+ inline = etree.SubElement(el, "inline")
+ inline.text = text
def _processUList(self, parent_elem, lines, inList):
self._processList(parent_elem, lines, inList,
@@ -1673,15 +1677,22 @@ class Markdown:
"""
def linkText(text):
- if result:
- result[-1].tail = text
- else:
- parent.text = text
+ if text:
+ if result:
+ if result[-1].tail:
+ result[-1].tail += text
+ else:
+ result[-1].tail = text
+ else:
+ if parent.text:
+ parent.text += text
+ else:
+ parent.text = text
result = []
prefix = self.inlineStash.prefix
strartIndex = 0
-
+
while data:
index = data.find(prefix, strartIndex)
@@ -1693,13 +1704,12 @@ class Markdown:
node = self.inlineStash.get(id)
+ if index > 0:
+ text = data[strartIndex:index]
+ linkText(text)
if not isstr(node): # it's Element
-
- if index > 0:
- text = data[strartIndex:index]
- linkText(text)
-
+
for child in [node] + node.getchildren():
if child.tail:
@@ -1724,8 +1734,7 @@ class Markdown:
else:
text = data[strartIndex:].strip()
- if text:
- linkText(text)
+ linkText(text)
data = ""
return result
@@ -1737,7 +1746,7 @@ class Markdown:
Given a pattern name, this function checks if the line
fits the pattern, creates the necessary elements, adds it
to InlineStash, and returns string with placeholders,
- instead of DOM elements.
+ instead of ElementTree elements.
Keyword arguments:
@@ -1772,19 +1781,18 @@ class Markdown:
pholder = self.inlineStash.add(node, pattern.type())
return "%s%s%s" % (match.group(1), pholder, match.groups()[-1]), True
-
def _processTree(self, el):
"""
- Processing NanoDOM markdown tree, and applying inline patterns
+ Processing ElementTree, and applying inline patterns
Keyword arguments:
* el - parent element of Document.
- Returns: NanoDOM Document object with applied inline patterns.
+ Returns: ElementTree object with applied inline patterns.
"""
-
+
stack = [el]
while stack:
currElement = stack.pop()
@@ -1792,34 +1800,45 @@ class Markdown:
for child in currElement.getchildren():
if child.tag == "inline":
-
+
lst = self._processPlaceholders(self._handleInline(
child.text), currElement)
-
+
pos = currElement.getchildren().index(child)
insertQueue.append((child, pos, lst))
else:
stack.append(child)
+
for element, pos, lst in insertQueue:
currElement.remove(element)
+ if currElement.text:
+ currElement.text = handleAttributes(currElement.text,
+ currElement)
for newChild in lst:
+ # Processing attributes
+ if newChild.tail:
+ newChild.tail = handleAttributes(newChild.tail,
+ currElement)
+ if newChild.text:
+ newChild.text = handleAttributes(newChild.text,
+ newChild)
currElement.insert(pos, newChild)
pos += 1
def applyInlinePatterns(self, markdownTree):
"""
- Retrun NanoDOM markdown tree, with applied
+ Retrun ElementTree, with applied
inline paterns
Keyword arguments:
- * markdownTree: NanoDOM Document object, reppresenting Markdown tree.
+ * markdownTree: ElementTree object, reppresenting Markdown tree.
- Returns: NanoDOM Document object.
+ Returns: ElementTree object.
"""
@@ -1833,14 +1852,14 @@ class Markdown:
def markdownToTree(self, source=None):
"""
- Retrun NanoDOM markdown tree, without applying
+ Retrun ElementTree, without applying
inline paterns
Keyword arguments:
* source: An ascii or unicode string of Markdown formated text.
- Returns: NanoDOM Document object.
+ Returns: ElementTree object.
"""
if source is not None: #Allow blank string
self.source = source
diff --git a/tests/markdown-test/amps-and-angle-encoding.html b/tests/markdown-test/amps-and-angle-encoding.html
index 18df2c3..9c565e5 100644
--- a/tests/markdown-test/amps-and-angle-encoding.html
+++ b/tests/markdown-test/amps-and-angle-encoding.html
@@ -1,21 +1,9 @@
-
-<p>AT&amp;T has an ampersand in their name.
-</p>
-<p>AT&amp;T is another way to write it.
-</p>
-<p>This &amp; that.
-</p>
-<p>4 &lt; 5.
-</p>
-<p>6 &gt; 5.
-</p>
-<p>Here's a <a href="http://example.com/?foo=1&amp;bar=2">link</a> with an ampersand in the URL.
-</p>
-<p>Here's a link with an amersand in the link text: <a href="http://att.com/" title="AT&amp;T">AT&amp;T</a>.
-</p>
-<p>Here's an inline <a href="/script?foo=1&amp;bar=2">link</a>.
-</p>
-<p>Here's an inline <a href="/script?foo=1&amp;bar=2">link</a>.
-</p>
-
-
+<p>AT&amp;T has an ampersand in their name.</p>
+<p>AT&amp;T is another way to write it.</p>
+<p>This &amp; that.</p>
+<p>4 &lt; 5.</p>
+<p>6 &gt; 5.</p>
+<p>Here's a <a href="http://example.com/?foo=1&amp;bar=2">link</a>with an ampersand in the URL.</p>
+<p>Here's a link with an amersand in the link text: <a href="http://att.com/" title="AT&amp;T">AT&amp;T</a>.</p>
+<p>Here's an inline <a href="/script?foo=1&amp;bar=2">link</a>.</p>
+<p>Here's an inline <a href="/script?foo=1&amp;bar=2">link</a>.</p> \ No newline at end of file
diff --git a/tests/markdown-test/auto-links.html b/tests/markdown-test/auto-links.html
index 976d22b..100db34 100644
--- a/tests/markdown-test/auto-links.html
+++ b/tests/markdown-test/auto-links.html
@@ -1,5 +1,4 @@
-<p>Link: <a href="http://example.com/">http://example.com/</a>.
-</p>
+<p>Link: <a href="http://example.com/">http://example.com/</a>.</p>
<p>Https link: <a href="https://example.com">https://example.com</a>
</p>
<p>Ftp link: <a href="ftp://example.com">ftp://example.com</a>
@@ -7,20 +6,19 @@
<p>With an ampersand: <a href="http://example.com/?foo=1&amp;bar=2">http://example.com/?foo=1&amp;bar=2</a>
</p>
<ul>
- <li>
- In a list?
- </li>
-
- <li><a href="http://example.com/">http://example.com/</a>
- </li>
-
- <li>
- It should.
- </li>
+<li>In a list?</li>
+<li>
+<a href="http://example.com/">http://example.com/</a>
+</li>
+<li>It should.</li>
</ul>
-<blockquote><p>Blockquoted: <a href="http://example.com/">http://example.com/</a>
+<blockquote>
+<p>Blockquoted: <a href="http://example.com/">http://example.com/</a>
</p>
-</blockquote><p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code>
+</blockquote>
+<p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code>
</p>
-<pre><code>or here: &lt;http://example.com/&gt;
-</code></pre>
+<pre>
+<code>or here: &lt;http://example.com/&gt;
+</code>
+</pre> \ No newline at end of file
diff --git a/tests/markdown-test/backlash-escapes.html b/tests/markdown-test/backlash-escapes.html
index 77ecde7..f99082a 100644
--- a/tests/markdown-test/backlash-escapes.html
+++ b/tests/markdown-test/backlash-escapes.html
@@ -1,41 +1,23 @@
-
-<p>These should all get escaped:
-</p>
-<p>Backslash: \
-</p>
-<p>Backtick: `
-</p>
-<p>Asterisk: *
-</p>
-<p>Underscore: _
-</p>
-<p>Left brace: {
-</p>
-<p>Right brace: }
-</p>
-<p>Left bracket: [
-</p>
-<p>Right bracket: ]
-</p>
-<p>Left paren: (
-</p>
-<p>Right paren: )
-</p>
-<p>Greater-than: &gt;
-</p>
-<p>Hash: #
-</p>
-<p>Period: .
-</p>
-<p>Bang: !
-</p>
-<p>Plus: +
-</p>
-<p>Minus: -
-</p>
-<p>These should not, because they occur within a code block:
-</p>
-<pre><code>Backslash: \\
+<p>These should all get escaped:</p>
+<p>Backslash: \</p>
+<p>Backtick: `</p>
+<p>Asterisk: *</p>
+<p>Underscore: _</p>
+<p>Left brace: {</p>
+<p>Right brace: }</p>
+<p>Left bracket: [</p>
+<p>Right bracket: ]</p>
+<p>Left paren: (</p>
+<p>Right paren: )</p>
+<p>Greater-than: &gt;</p>
+<p>Hash: #</p>
+<p>Period: .</p>
+<p>Bang: !</p>
+<p>Plus: +</p>
+<p>Minus: -</p>
+<p>These should not, because they occur within a code block:</p>
+<pre>
+<code>Backslash: \\
Backtick: \`
@@ -66,8 +48,9 @@ Bang: \!
Plus: \+
Minus: \-
-</code></pre><p>Nor should these, which occur in code spans:
-</p>
+</code>
+</pre>
+<p>Nor should these, which occur in code spans:</p>
<p>Backslash: <code>\\</code>
</p>
<p>Backtick: <code>\`</code>
@@ -99,6 +82,4 @@ Minus: \-
<p>Plus: <code>\+</code>
</p>
<p>Minus: <code>\-</code>
-</p>
-
-
+</p> \ No newline at end of file
diff --git a/tests/markdown-test/blockquotes-with-dode-blocks.html b/tests/markdown-test/blockquotes-with-dode-blocks.html
index 275749f..e7c79d9 100644
--- a/tests/markdown-test/blockquotes-with-dode-blocks.html
+++ b/tests/markdown-test/blockquotes-with-dode-blocks.html
@@ -1,13 +1,16 @@
-
-<blockquote><p>Example:
-</p>
-<pre><code>sub status {
+<blockquote>
+<p>Example:</p>
+<pre>
+<code>sub status {
print "working";
}
-</code></pre><p>Or:
-</p>
-<pre><code>sub status {
+</code>
+</pre>
+<p>Or:</p>
+<pre>
+<code>sub status {
return "working";
}
-</code></pre></blockquote>
-
+</code>
+</pre>
+</blockquote> \ No newline at end of file
diff --git a/tests/markdown-test/hard-wrapped.html b/tests/markdown-test/hard-wrapped.html
index 7d16a85..e28e900 100644
--- a/tests/markdown-test/hard-wrapped.html
+++ b/tests/markdown-test/hard-wrapped.html
@@ -1,12 +1,7 @@
-
<p>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.
-</p>
+8. This line turns into a list item.
+Because a hard-wrapped line in the
+middle of a paragraph looked like a
+list item.</p>
<p>Here's one with a bullet.
- * criminey.
-</p>
-
-
+* criminey.</p> \ No newline at end of file
diff --git a/tests/markdown-test/horizontal-rules.html b/tests/markdown-test/horizontal-rules.html
index 253e36a..98c9c90 100644
--- a/tests/markdown-test/horizontal-rules.html
+++ b/tests/markdown-test/horizontal-rules.html
@@ -1,63 +1,51 @@
-
-<p>Dashes:
-</p>
+<p>Dashes:</p>
<hr />
-
<hr />
-
<hr />
-
<hr />
-
-<pre><code>---
-</code></pre><hr />
-
+<pre>
+<code>---
+</code>
+</pre>
<hr />
-
<hr />
-
<hr />
-
-<pre><code>- - -
-</code></pre><p>Asterisks:
-</p>
<hr />
-
+<pre>
+<code>- - -
+</code>
+</pre>
+<p>Asterisks:</p>
<hr />
-
<hr />
-
<hr />
-
-<pre><code>***
-</code></pre><hr />
-
<hr />
-
+<pre>
+<code>***
+</code>
+</pre>
<hr />
-
<hr />
-
-<pre><code>* * *
-</code></pre><p>Underscores:
-</p>
<hr />
-
<hr />
-
+<pre>
+<code>* * *
+</code>
+</pre>
+<p>Underscores:</p>
<hr />
-
<hr />
-
-<pre><code>___
-</code></pre><hr />
-
<hr />
-
<hr />
-
+<pre>
+<code>___
+</code>
+</pre>
<hr />
-
-<pre><code>_ _ _
-</code></pre>
-
+<hr />
+<hr />
+<hr />
+<pre>
+<code>_ _ _
+</code>
+</pre>
diff --git a/tests/markdown-test/inline-html-advanced.html b/tests/markdown-test/inline-html-advanced.html
index c72bebb..0f922e9 100644
--- a/tests/markdown-test/inline-html-advanced.html
+++ b/tests/markdown-test/inline-html-advanced.html
@@ -1,18 +1,11 @@
-
-<p>Simple block on one line:
-</p>
-<div>foo</div>
-
-<p>And nested without indentation:
-</p>
-<div>
+<p>Simple block on one line:</p>
+<p><div>foo</div></p>
+<p>And nested without indentation:</p>
+<p><div>
<div>
<div>
foo
</div>
</div>
<div>bar</div>
-</div>
-
-
-
+</div></p> \ No newline at end of file
diff --git a/tests/markdown-test/inline-html-comments.html b/tests/markdown-test/inline-html-comments.html
index a85c8b2..8b538d6 100644
--- a/tests/markdown-test/inline-html-comments.html
+++ b/tests/markdown-test/inline-html-comments.html
@@ -1,17 +1,8 @@
-
-<p>Paragraph one.
-</p>
-<!-- This is a simple comment -->
-
-<!--
+<p>Paragraph one.</p>
+<p><!-- This is a simple comment --></p>
+<p><!--
This is another comment.
--->
-
-<p>Paragraph two.
-</p>
-<!-- one comment block -- -- with two comments -->
-
-<p>The end.
-</p>
-
-
+--></p>
+<p>Paragraph two.</p>
+<p><!-- one comment block -- -- with two comments --></p>
+<p>The end.</p> \ No newline at end of file
diff --git a/tests/markdown-test/inline-html-simple.html b/tests/markdown-test/inline-html-simple.html
index b5b3f12..efb50dc 100644
--- a/tests/markdown-test/inline-html-simple.html
+++ b/tests/markdown-test/inline-html-simple.html
@@ -1,68 +1,53 @@
-
-<p>Here's a simple block:
-</p>
-<div>
+<p>Here's a simple block:</p>
+<p><div>
foo
-</div>
-
-<p>This should be a code block, though:
-</p>
-<pre><code>&lt;div&gt;
+</div></p>
+<p>This should be a code block, though:</p>
+<pre>
+<code>&lt;div&gt;
foo
&lt;/div&gt;
-</code></pre><p>As should this:
-</p>
-<pre><code>&lt;div&gt;foo&lt;/div&gt;
-</code></pre><p>Now, nested:
-</p>
-<div>
+</code>
+</pre>
+<p>As should this:</p>
+<pre>
+<code>&lt;div&gt;foo&lt;/div&gt;
+</code>
+</pre>
+<p>Now, nested:</p>
+<p><div>
<div>
<div>
foo
</div>
</div>
-</div>
-
-<p>This should just be an HTML comment:
-</p>
-<!-- Comment -->
-
-<p>Multiline:
-</p>
-<!--
+</div></p>
+<p>This should just be an HTML comment:</p>
+<p><!-- Comment --></p>
+<p>Multiline:</p>
+<p><!--
Blah
Blah
--->
-
-<p>Code block:
-</p>
-<pre><code>&lt;!-- Comment --&gt;
-</code></pre><p>Just plain comment, with trailing spaces on the line:
-</p>
-<!-- foo -->
-
-<p>Code:
-</p>
-<pre><code>&lt;hr /&gt;
-</code></pre><p>Hr's:
-</p>
-<hr>
-
-<hr/>
-
-<hr />
-
-<hr>
-
-<hr/>
-
-<hr />
-
-<hr class="foo" id="bar" />
-
-<hr class="foo" id="bar"/>
-
-<hr class="foo" id="bar" >
-
-
-
+--></p>
+<p>Code block:</p>
+<pre>
+<code>&lt;!-- Comment --&gt;
+</code>
+</pre>
+<p>Just plain comment, with trailing spaces on the line:</p>
+<p><!-- foo --></p>
+<p>Code:</p>
+<pre>
+<code>&lt;hr /&gt;
+</code>
+</pre>
+<p>Hr's:</p>
+<p><hr></p>
+<p><hr/></p>
+<p><hr /></p>
+<p><hr></p>
+<p><hr/></p>
+<p><hr /></p>
+<p><hr class="foo" id="bar" /></p>
+<p><hr class="foo" id="bar"/></p>
+<p><hr class="foo" id="bar" ></p> \ No newline at end of file
diff --git a/tests/markdown-test/links-inline.html b/tests/markdown-test/links-inline.html
index 5fb7073..e1aaf27 100644
--- a/tests/markdown-test/links-inline.html
+++ b/tests/markdown-test/links-inline.html
@@ -1,13 +1,9 @@
-
-<p>Just a <a href="/url/">URL</a>.
-</p>
-<p><a href="/url/" title="title">URL and title</a>.
-</p>
-<p><a href="/url/" title="title preceded by two spaces">URL and title</a>.
-</p>
-<p><a href="/url/" title="title preceded by a tab">URL and title</a>.
-</p>
-<p><a href="">Empty</a>.
-</p>
-
-
+<p>Just a <a href="/url/">URL</a>.</p>
+<p>
+<a href="/url/" title="title">URL and title</a>.</p>
+<p>
+<a href="/url/" title="title preceded by two spaces">URL and title</a>.</p>
+<p>
+<a href="/url/" title="title preceded by a tab">URL and title</a>.</p>
+<p>
+<a href="">Empty</a>.</p> \ No newline at end of file
diff --git a/tests/markdown-test/links-reference.html b/tests/markdown-test/links-reference.html
index ad6438f..338aa22 100644
--- a/tests/markdown-test/links-reference.html
+++ b/tests/markdown-test/links-reference.html
@@ -1,20 +1,12 @@
-
-<p>Foo <a href="/url/" title="Title">bar</a>.
-</p>
-<p>Foo <a href="/url/" title="Title">bar</a>.
-</p>
-<p>Foo <a href="/url/" title="Title">bar</a>.
-</p>
-<p>With <a href="/url/">embedded [brackets]</a>.
-</p>
-<p>Indented <a href="/url">once</a>.
-</p>
-<p>Indented <a href="/url">twice</a>.
-</p>
-<p>Indented <a href="/url">thrice</a>.
-</p>
-<p>Indented [four][] times.
-</p>
-<pre><code>[four]: /url
-</code></pre>
-
+<p>Foo <a href="/url/" title="Title">bar</a>.</p>
+<p>Foo <a href="/url/" title="Title">bar</a>.</p>
+<p>Foo <a href="/url/" title="Title">bar</a>.</p>
+<p>With <a href="/url/">embedded [brackets]</a>.</p>
+<p>Indented <a href="/url">once</a>.</p>
+<p>Indented <a href="/url">twice</a>.</p>
+<p>Indented <a href="/url">thrice</a>.</p>
+<p>Indented [four][] times.</p>
+<pre>
+<code>[four]: /url
+</code>
+</pre> \ No newline at end of file
diff --git a/tests/markdown-test/literal-quotes.html b/tests/markdown-test/literal-quotes.html
index 806b7f2..0342589 100644
--- a/tests/markdown-test/literal-quotes.html
+++ b/tests/markdown-test/literal-quotes.html
@@ -1,7 +1,2 @@
-
-<p>Foo <a href="/url/" title="Title with &quot;quotes&quot; inside">bar</a>.
-</p>
-<p>Foo <a href="/url/" title="Title with &quot;quotes&quot; inside">bar</a>.
-</p>
-
-
+<p>Foo <a href="/url/" title="Title with &quot;quotes&quot; inside">bar</a>.</p>
+<p>Foo <a href="/url/" title="Title with &quot;quotes&quot; inside">bar</a>.</p> \ No newline at end of file
diff --git a/tests/markdown-test/markdown-documentation-basics.html b/tests/markdown-test/markdown-documentation-basics.html
index 744e89d..9c5259f 100644
--- a/tests/markdown-test/markdown-documentation-basics.html
+++ b/tests/markdown-test/markdown-documentation-basics.html
@@ -1,47 +1,39 @@
<h1>Markdown: Basics</h1>
-<ul id="ProjectSubmenu">
+<p><ul id="ProjectSubmenu">
<li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li>
<li><a class="selected" title="Markdown Basics">Basics</a></li>
<li><a href="/projects/markdown/syntax" title="Markdown Syntax Documentation">Syntax</a></li>
<li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li>
<li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li>
-</ul>
-
-
+</ul></p>
<h2>Getting the Gist of Markdown's Formatting Syntax</h2>
<p>This page offers a brief overview of what it's like to use Markdown.
- The <a href="/projects/markdown/syntax" title="Markdown Syntax">syntax page</a> 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.
-</p>
-<p>It's also helpful to simply try Markdown out; the <a href="/projects/markdown/dingus" title="Markdown Dingus">Dingus</a> is a
- web application that allows you type your own Markdown-formatted text
- and translate it to XHTML.
-</p>
-<p><strong>Note:</strong> This document is itself written using Markdown; you
- can <a href="/projects/markdown/basics.text">see the source for it by adding '.text' to the URL</a>.
-</p>
-
+The <a href="/projects/markdown/syntax" title="Markdown Syntax">syntax page</a>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.</p>
+<p>It's also helpful to simply try Markdown out; the <a href="/projects/markdown/dingus" title="Markdown Dingus">Dingus</a>is a
+web application that allows you type your own Markdown-formatted text
+and translate it to XHTML.</p>
+<p>
+<strong>Note:</strong> This document is itself written using Markdown; you
+can <a href="/projects/markdown/basics.text">see the source for it by adding '.text' to the URL</a>.</p>
<h2>Paragraphs, Headers, Blockquotes</h2>
<p>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.
-</p>
+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.</p>
<p>Markdown offers two styles of headers: <em>Setext</em> and <em>atx</em>.
- Setext-style headers for <code>&lt;h1&gt;</code> and <code>&lt;h2&gt;</code> are created by
- "underlining" with equal signs (<code>=</code>) and hyphens (<code>-</code>), respectively.
- To create an atx-style header, you put 1-6 hash marks (<code>#</code>) at the
- beginning of the line -- the number of hashes equals the resulting
- HTML header level.
-</p>
-<p>Blockquotes are indicated using email-style '<code>&gt;</code>' angle brackets.
-</p>
-<p>Markdown:
-</p>
-<pre><code>A First Level Header
+Setext-style headers for <code>&lt;h1&gt;</code> and <code>&lt;h2&gt;</code> are created by
+"underlining" with equal signs (<code>=</code>) and hyphens (<code>-</code>), respectively.
+To create an atx-style header, you put 1-6 hash marks (<code>#</code>) at the
+beginning of the line -- the number of hashes equals the resulting
+HTML header level.</p>
+<p>Blockquotes are indicated using email-style '<code>&gt;</code>' angle brackets.</p>
+<p>Markdown:</p>
+<pre>
+<code>A First Level Header
====================
A Second Level Header
@@ -61,9 +53,11 @@ dog's back.
&gt; This is the second paragraph in the blockquote.
&gt;
&gt; ## This is an H2 in a blockquote
-</code></pre><p>Output:
-</p>
-<pre><code>&lt;h1&gt;A First Level Header&lt;/h1&gt;
+</code>
+</pre>
+<p>Output:</p>
+<pre>
+<code>&lt;h1&gt;A First Level Header&lt;/h1&gt;
&lt;h2&gt;A Second Level Header&lt;/h2&gt;
@@ -83,179 +77,221 @@ dog's back.&lt;/p&gt;
&lt;h2&gt;This is an H2 in a blockquote&lt;/h2&gt;
&lt;/blockquote&gt;
-</code></pre>
+</code>
+</pre>
<h3>Phrase Emphasis</h3>
-<p>Markdown uses asterisks and underscores to indicate spans of emphasis.
-</p>
-<p>Markdown:
-</p>
-<pre><code>Some of these words *are emphasized*.
+<p>Markdown uses asterisks and underscores to indicate spans of emphasis.</p>
+<p>Markdown:</p>
+<pre>
+<code>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__.
-</code></pre><p>Output:
-</p>
-<pre><code>&lt;p&gt;Some of these words &lt;em&gt;are emphasized&lt;/em&gt;.
+</code>
+</pre>
+<p>Output:</p>
+<pre>
+<code>&lt;p&gt;Some of these words &lt;em&gt;are emphasized&lt;/em&gt;.
Some of these words &lt;em&gt;are emphasized also&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Use two asterisks for &lt;strong&gt;strong emphasis&lt;/strong&gt;.
Or, if you prefer, &lt;strong&gt;use two underscores instead&lt;/strong&gt;.&lt;/p&gt;
-</code></pre>
+</code>
+</pre>
<h2>Lists</h2>
<p>Unordered (bulleted) lists use asterisks, pluses, and hyphens (<code>*</code>,
- <code>+</code>, and <code>-</code>) as list markers. These three markers are
- interchangable; this:
-</p>
-<pre><code>* Candy.
+<code>+</code>, and <code>-</code>) as list markers. These three markers are
+interchangable; this:</p>
+<pre>
+<code>* Candy.
* Gum.
* Booze.
-</code></pre><p>this:
-</p>
-<pre><code>+ Candy.
+</code>
+</pre>
+<p>this:</p>
+<pre>
+<code>+ Candy.
+ Gum.
+ Booze.
-</code></pre><p>and this:
-</p>
-<pre><code>- Candy.
+</code>
+</pre>
+<p>and this:</p>
+<pre>
+<code>- Candy.
- Gum.
- Booze.
-</code></pre><p>all produce the same output:
-</p>
-<pre><code>&lt;ul&gt;
+</code>
+</pre>
+<p>all produce the same output:</p>
+<pre>
+<code>&lt;ul&gt;
&lt;li&gt;Candy.&lt;/li&gt;
&lt;li&gt;Gum.&lt;/li&gt;
&lt;li&gt;Booze.&lt;/li&gt;
&lt;/ul&gt;
-</code></pre><p>Ordered (numbered) lists use regular numbers, followed by periods, as
- list markers:
-</p>
-<pre><code>1. Red
+</code>
+</pre>
+<p>Ordered (numbered) lists use regular numbers, followed by periods, as
+list markers:</p>
+<pre>
+<code>1. Red
2. Green
3. Blue
-</code></pre><p>Output:
-</p>
-<pre><code>&lt;ol&gt;
+</code>
+</pre>
+<p>Output:</p>
+<pre>
+<code>&lt;ol&gt;
&lt;li&gt;Red&lt;/li&gt;
&lt;li&gt;Green&lt;/li&gt;
&lt;li&gt;Blue&lt;/li&gt;
&lt;/ol&gt;
-</code></pre><p>If you put blank lines between items, you'll get <code>&lt;p&gt;</code> tags for the
- list item text. You can create multi-paragraph list items by indenting
- the paragraphs by 4 spaces or 1 tab:
-</p>
-<pre><code>* A list item.
+</code>
+</pre>
+<p>If you put blank lines between items, you'll get <code>&lt;p&gt;</code>tags for the
+list item text. You can create multi-paragraph list items by indenting
+the paragraphs by 4 spaces or 1 tab:</p>
+<pre>
+<code>* A list item.
With multiple paragraphs.
* Another item in the list.
-</code></pre><p>Output:
-</p>
-<pre><code>&lt;ul&gt;
+</code>
+</pre>
+<p>Output:</p>
+<pre>
+<code>&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A list item.&lt;/p&gt;
&lt;p&gt;With multiple paragraphs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Another item in the list.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
-</code></pre>
+</code>
+</pre>
<h3>Links</h3>
<p>Markdown supports two styles for creating links: <em>inline</em> and
- <em>reference</em>. With both styles, you use square brackets to delimit the
- text you want to turn into a link.
-</p>
+<em>reference</em>. With both styles, you use square brackets to delimit the
+text you want to turn into a link.</p>
<p>Inline-style links use parentheses immediately after the link text.
- For example:
-</p>
-<pre><code>This is an [example link](http://example.com/).
-</code></pre><p>Output:
-</p>
-<pre><code>&lt;p&gt;This is an &lt;a href="http://example.com/"&gt;
+For example:</p>
+<pre>
+<code>This is an [example link](http://example.com/).
+</code>
+</pre>
+<p>Output:</p>
+<pre>
+<code>&lt;p&gt;This is an &lt;a href="http://example.com/"&gt;
example link&lt;/a&gt;.&lt;/p&gt;
-</code></pre><p>Optionally, you may include a title attribute in the parentheses:
-</p>
-<pre><code>This is an [example link](http://example.com/ "With a Title").
-</code></pre><p>Output:
-</p>
-<pre><code>&lt;p&gt;This is an &lt;a href="http://example.com/" title="With a Title"&gt;
+</code>
+</pre>
+<p>Optionally, you may include a title attribute in the parentheses:</p>
+<pre>
+<code>This is an [example link](http://example.com/ "With a Title").
+</code>
+</pre>
+<p>Output:</p>
+<pre>
+<code>&lt;p&gt;This is an &lt;a href="http://example.com/" title="With a Title"&gt;
example link&lt;/a&gt;.&lt;/p&gt;
-</code></pre><p>Reference-style links allow you to refer to your links by names, which
- you define elsewhere in your document:
-</p>
-<pre><code>I get 10 times more traffic from [Google][1] than from
+</code>
+</pre>
+<p>Reference-style links allow you to refer to your links by names, which
+you define elsewhere in your document:</p>
+<pre>
+<code>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"
-</code></pre><p>Output:
-</p>
-<pre><code>&lt;p&gt;I get 10 times more traffic from &lt;a href="http://google.com/"
+</code>
+</pre>
+<p>Output:</p>
+<pre>
+<code>&lt;p&gt;I get 10 times more traffic from &lt;a href="http://google.com/"
title="Google"&gt;Google&lt;/a&gt; than from &lt;a href="http://search.yahoo.com/"
title="Yahoo Search"&gt;Yahoo&lt;/a&gt; or &lt;a href="http://search.msn.com/"
title="MSN Search"&gt;MSN&lt;/a&gt;.&lt;/p&gt;
-</code></pre><p>The title attribute is optional. Link names may contain letters,
- numbers and spaces, but are <em>not</em> case sensitive:
-</p>
-<pre><code>I start my morning with a cup of coffee and
+</code>
+</pre>
+<p>The title attribute is optional. Link names may contain letters,
+numbers and spaces, but are <em>not</em>case sensitive:</p>
+<pre>
+<code>I start my morning with a cup of coffee and
[The New York Times][NY Times].
[ny times]: http://www.nytimes.com/
-</code></pre><p>Output:
-</p>
-<pre><code>&lt;p&gt;I start my morning with a cup of coffee and
+</code>
+</pre>
+<p>Output:</p>
+<pre>
+<code>&lt;p&gt;I start my morning with a cup of coffee and
&lt;a href="http://www.nytimes.com/"&gt;The New York Times&lt;/a&gt;.&lt;/p&gt;
-</code></pre>
+</code>
+</pre>
<h3>Images</h3>
-<p>Image syntax is very much like link syntax.
-</p>
-<p>Inline (titles are optional):
-</p>
-<pre><code>![alt text](/path/to/img.jpg "Title")
-</code></pre><p>Reference-style:
-</p>
-<pre><code>![alt text][id]
+<p>Image syntax is very much like link syntax.</p>
+<p>Inline (titles are optional):</p>
+<pre>
+<code>![alt text](/path/to/img.jpg "Title")
+</code>
+</pre>
+<p>Reference-style:</p>
+<pre>
+<code>![alt text][id]
[id]: /path/to/img.jpg "Title"
-</code></pre><p>Both of the above examples produce the same output:
-</p>
-<pre><code>&lt;img src="/path/to/img.jpg" alt="alt text" title="Title" /&gt;
-</code></pre>
+</code>
+</pre>
+<p>Both of the above examples produce the same output:</p>
+<pre>
+<code>&lt;img src="/path/to/img.jpg" alt="alt text" title="Title" /&gt;
+</code>
+</pre>
<h3>Code</h3>
<p>In a regular paragraph, you can create code span by wrapping text in
- backtick quotes. Any ampersands (<code>&amp;</code>) and angle brackets (<code>&lt;</code> or
- <code>&gt;</code>) will automatically be translated into HTML entities. This makes
- it easy to use Markdown to write about HTML example code:
-</p>
-<pre><code>I strongly recommend against using any `&lt;blink&gt;` tags.
+backtick quotes. Any ampersands (<code>&amp;</code>) and angle brackets (<code>&lt;</code> or
+<code>&gt;</code>) will automatically be translated into HTML entities. This makes
+it easy to use Markdown to write about HTML example code:</p>
+<pre>
+<code>I strongly recommend against using any `&lt;blink&gt;` tags.
I wish SmartyPants used named entities like `&amp;mdash;`
instead of decimal-encoded entites like `&amp;#8212;`.
-</code></pre><p>Output:
-</p>
-<pre><code>&lt;p&gt;I strongly recommend against using any
+</code>
+</pre>
+<p>Output:</p>
+<pre>
+<code>&lt;p&gt;I strongly recommend against using any
&lt;code&gt;&amp;lt;blink&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;
&lt;p&gt;I wish SmartyPants used named entities like
&lt;code&gt;&amp;amp;mdash;&lt;/code&gt; instead of decimal-encoded
entites like &lt;code&gt;&amp;amp;#8212;&lt;/code&gt;.&lt;/p&gt;
-</code></pre><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, <code>&amp;</code>, <code>&lt;</code>,
- and <code>&gt;</code> characters will be escaped automatically.
-</p>
-<p>Markdown:
-</p>
-<pre><code>If you want your page to validate under XHTML 1.0 Strict,
+</code>
+</pre>
+<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, <code>&amp;</code>, <code>&lt;</code>,
+and <code>&gt;</code>characters will be escaped automatically.</p>
+<p>Markdown:</p>
+<pre>
+<code>If you want your page to validate under XHTML 1.0 Strict,
you've got to put paragraph tags in your blockquotes:
&lt;blockquote&gt;
&lt;p&gt;For example.&lt;/p&gt;
&lt;/blockquote&gt;
-</code></pre><p>Output:
-</p>
-<pre><code>&lt;p&gt;If you want your page to validate under XHTML 1.0 Strict,
+</code>
+</pre>
+<p>Output:</p>
+<pre>
+<code>&lt;p&gt;If you want your page to validate under XHTML 1.0 Strict,
you've got to put paragraph tags in your blockquotes:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;blockquote&amp;gt;
&amp;lt;p&amp;gt;For example.&amp;lt;/p&amp;gt;
&amp;lt;/blockquote&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
-</code></pre> \ No newline at end of file
+</code>
+</pre>
diff --git a/tests/markdown-test/markdown-syntax.html b/tests/markdown-test/markdown-syntax.html
index 40f9547..84fe3bd 100644
--- a/tests/markdown-test/markdown-syntax.html
+++ b/tests/markdown-test/markdown-syntax.html
@@ -1,128 +1,120 @@
<h1>Markdown: Syntax</h1>
-<ul id="ProjectSubmenu">
+<p><ul id="ProjectSubmenu">
<li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li>
<li><a href="/projects/markdown/basics" title="Markdown Basics">Basics</a></li>
<li><a class="selected" title="Markdown Syntax Documentation">Syntax</a></li>
<li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li>
<li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li>
-</ul>
-
+</ul></p>
<ul>
- <li><a href="#overview">Overview</a><ul>
- <li><a href="#philosophy">Philosophy</a>
- </li>
-
- <li><a href="#html">Inline HTML</a>
- </li>
-
- <li><a href="#autoescape">Automatic Escaping for Special Characters</a>
- </li>
+<li>
+<a href="#overview">Overview</a>
+<ul>
+<li>
+<a href="#philosophy">Philosophy</a>
+</li>
+<li>
+<a href="#html">Inline HTML</a>
+</li>
+<li>
+<a href="#autoescape">Automatic Escaping for Special Characters</a>
+</li>
</ul>
-
- </li>
-
- <li><a href="#block">Block Elements</a><ul>
- <li><a href="#p">Paragraphs and Line Breaks</a>
- </li>
-
- <li><a href="#header">Headers</a>
- </li>
-
- <li><a href="#blockquote">Blockquotes</a>
- </li>
-
- <li><a href="#list">Lists</a>
- </li>
-
- <li><a href="#precode">Code Blocks</a>
- </li>
-
- <li><a href="#hr">Horizontal Rules</a>
- </li>
+</li>
+<li>
+<a href="#block">Block Elements</a>
+<ul>
+<li>
+<a href="#p">Paragraphs and Line Breaks</a>
+</li>
+<li>
+<a href="#header">Headers</a>
+</li>
+<li>
+<a href="#blockquote">Blockquotes</a>
+</li>
+<li>
+<a href="#list">Lists</a>
+</li>
+<li>
+<a href="#precode">Code Blocks</a>
+</li>
+<li>
+<a href="#hr">Horizontal Rules</a>
+</li>
</ul>
-
- </li>
-
- <li><a href="#span">Span Elements</a><ul>
- <li><a href="#link">Links</a>
- </li>
-
- <li><a href="#em">Emphasis</a>
- </li>
-
- <li><a href="#code">Code</a>
- </li>
-
- <li><a href="#img">Images</a>
- </li>
+</li>
+<li>
+<a href="#span">Span Elements</a>
+<ul>
+<li>
+<a href="#link">Links</a>
+</li>
+<li>
+<a href="#em">Emphasis</a>
+</li>
+<li>
+<a href="#code">Code</a>
+</li>
+<li>
+<a href="#img">Images</a>
+</li>
</ul>
-
- </li>
-
- <li><a href="#misc">Miscellaneous</a><ul>
- <li><a href="#backslash">Backslash Escapes</a>
- </li>
-
- <li><a href="#autolink">Automatic Links</a>
- </li>
+</li>
+<li>
+<a href="#misc">Miscellaneous</a>
+<ul>
+<li>
+<a href="#backslash">Backslash Escapes</a>
+</li>
+<li>
+<a href="#autolink">Automatic Links</a>
+</li>
</ul>
-
- </li>
+</li>
</ul>
-<p><strong>Note:</strong> This document is itself written using Markdown; you
- can <a href="/projects/markdown/syntax.text">see the source for it by adding '.text' to the URL</a>.
-</p>
+<p>
+<strong>Note:</strong> This document is itself written using Markdown; you
+can <a href="/projects/markdown/syntax.text">see the source for it by adding '.text' to the URL</a>.</p>
<hr />
-
-<h2 id="overview">Overview</h2>
-
-<h3 id="philosophy">Philosophy</h3>
-
-<p>Markdown is intended to be as easy-to-read and easy-to-write as is feasible.
-</p>
+<p><h2 id="overview">Overview</h2></p>
+<p><h3 id="philosophy">Philosophy</h3></p>
+<p>Markdown is intended to be as easy-to-read and easy-to-write as is feasible.</p>
<p>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 <a href="http://docutils.sourceforge.net/mirror/setext.html">Setext</a>, <a href="http://www.aaronsw.com/2002/atx/">atx</a>, <a href="http://textism.com/tools/textile/">Textile</a>, <a href="http://docutils.sourceforge.net/rst.html">reStructuredText</a>,
- <a href="http://www.triptico.com/software/grutatxt.html">Grutatext</a>, and <a href="http://ettext.taint.org/doc/">EtText</a> -- the single biggest source of
- inspiration for Markdown's syntax is the format of plain text email.
-</p>
+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 <a href="http://docutils.sourceforge.net/mirror/setext.html">Setext</a>, <a href="http://www.aaronsw.com/2002/atx/">atx</a>, <a href="http://textism.com/tools/textile/">Textile</a>, <a href="http://docutils.sourceforge.net/rst.html">reStructuredText</a>,
+<a href="http://www.triptico.com/software/grutatxt.html">Grutatext</a>, and <a href="http://ettext.taint.org/doc/">EtText</a>-- the single biggest source of
+inspiration for Markdown's syntax is the format of plain text email.</p>
<p>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.
-</p>
-<h3 id="html">Inline HTML</h3>
-
+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.</p>
+<p><h3 id="html">Inline HTML</h3></p>
<p>Markdown's syntax is intended for one purpose: to be used as a
- format for <em>writing</em> for the web.
-</p>
+format for <em>writing</em>for the web.</p>
<p>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 <em>not</em> 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 <em>publishing</em> format; Markdown is a <em>writing</em>
- format. Thus, Markdown's formatting syntax only addresses issues that
- can be conveyed in plain text.
-</p>
+syntax is very small, corresponding only to a very small subset of
+HTML tags. The idea is <em>not</em> 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 <em>publishing</em> format; Markdown is a <em>writing</em>format. Thus, Markdown's formatting syntax only addresses issues that
+can be conveyed in plain text.</p>
<p>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.
-</p>
+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.</p>
<p>The only restrictions are that block-level HTML elements -- e.g. <code>&lt;div&gt;</code>,
- <code>&lt;table&gt;</code>, <code>&lt;pre&gt;</code>, <code>&lt;p&gt;</code>, 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) <code>&lt;p&gt;</code> tags around HTML block-level tags.
-</p>
-<p>For example, to add an HTML table to a Markdown article:
-</p>
-<pre><code>This is a regular paragraph.
+<code>&lt;table&gt;</code>, <code>&lt;pre&gt;</code>, <code>&lt;p&gt;</code>, 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) <code>&lt;p&gt;</code>tags around HTML block-level tags.</p>
+<p>For example, to add an HTML table to a Markdown article:</p>
+<pre>
+<code>This is a regular paragraph.
&lt;table&gt;
&lt;tr&gt;
@@ -131,159 +123,167 @@
&lt;/table&gt;
This is another regular paragraph.
-</code></pre><p>Note that Markdown formatting syntax is not processed within block-level
- HTML tags. E.g., you can't use Markdown-style <code>*emphasis*</code> inside an
- HTML block.
-</p>
+</code>
+</pre>
+<p>Note that Markdown formatting syntax is not processed within block-level
+HTML tags. E.g., you can't use Markdown-style <code>*emphasis*</code>inside an
+HTML block.</p>
<p>Span-level HTML tags -- e.g. <code>&lt;span&gt;</code>, <code>&lt;cite&gt;</code>, or <code>&lt;del&gt;</code> -- 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 <code>&lt;a&gt;</code> or <code>&lt;img&gt;</code> tags instead of Markdown's
- link or image syntax, go right ahead.
-</p>
-<p>Unlike block-level HTML tags, Markdown syntax <em>is</em> processed within
- span-level tags.
-</p>
-<h3 id="autoescape">Automatic Escaping for Special Characters</h3>
-
+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 <code>&lt;a&gt;</code> or <code>&lt;img&gt;</code>tags instead of Markdown's
+link or image syntax, go right ahead.</p>
+<p>Unlike block-level HTML tags, Markdown syntax <em>is</em>processed within
+span-level tags.</p>
+<p><h3 id="autoescape">Automatic Escaping for Special Characters</h3></p>
<p>In HTML, there are two characters that demand special treatment: <code>&lt;</code>
- and <code>&amp;</code>. 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. <code>&amp;lt;</code>, and
- <code>&amp;amp;</code>.
-</p>
+and <code>&amp;</code>. 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. <code>&amp;lt;</code>, and
+<code>&amp;amp;</code>.</p>
<p>Ampersands in particular are bedeviling for web writers. If you want to
- write about 'AT&amp;T', you need to write '<code>AT&amp;amp;T</code>'. You even need to
- escape ampersands within URLs. Thus, if you want to link to:
-</p>
-<pre><code>http://images.google.com/images?num=30&amp;q=larry+bird
-</code></pre><p>you need to encode the URL as:
-</p>
-<pre><code>http://images.google.com/images?num=30&amp;amp;q=larry+bird
-</code></pre><p>in your anchor tag <code>href</code> 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.
-</p>
+write about 'AT&amp;T', you need to write '<code>AT&amp;amp;T</code>'. You even need to
+escape ampersands within URLs. Thus, if you want to link to:</p>
+<pre>
+<code>http://images.google.com/images?num=30&amp;q=larry+bird
+</code>
+</pre>
+<p>you need to encode the URL as:</p>
+<pre>
+<code>http://images.google.com/images?num=30&amp;amp;q=larry+bird
+</code>
+</pre>
+<p>in your anchor tag <code>href</code>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.</p>
<p>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 <code>&amp;amp;</code>.
-</p>
-<p>So, if you want to include a copyright symbol in your article, you can write:
-</p>
-<pre><code>&amp;copy;
-</code></pre><p>and Markdown will leave it alone. But if you write:
-</p>
-<pre><code>AT&amp;T
-</code></pre><p>Markdown will translate it to:
-</p>
-<pre><code>AT&amp;amp;T
-</code></pre><p>Similarly, because Markdown supports <a href="#html">inline HTML</a>, if you use
- angle brackets as delimiters for HTML tags, Markdown will treat them as
- such. But if you write:
-</p>
-<pre><code>4 &lt; 5
-</code></pre><p>Markdown will translate it to:
-</p>
-<pre><code>4 &amp;lt; 5
-</code></pre><p>However, inside Markdown code spans and blocks, angle brackets and
- ampersands are <em>always</em> 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 <code>&lt;</code>
- and <code>&amp;</code> in your example code needs to be escaped.)
-</p>
+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 <code>&amp;amp;</code>.</p>
+<p>So, if you want to include a copyright symbol in your article, you can write:</p>
+<pre>
+<code>&amp;copy;
+</code>
+</pre>
+<p>and Markdown will leave it alone. But if you write:</p>
+<pre>
+<code>AT&amp;T
+</code>
+</pre>
+<p>Markdown will translate it to:</p>
+<pre>
+<code>AT&amp;amp;T
+</code>
+</pre>
+<p>Similarly, because Markdown supports <a href="#html">inline HTML</a>, if you use
+angle brackets as delimiters for HTML tags, Markdown will treat them as
+such. But if you write:</p>
+<pre>
+<code>4 &lt; 5
+</code>
+</pre>
+<p>Markdown will translate it to:</p>
+<pre>
+<code>4 &amp;lt; 5
+</code>
+</pre>
+<p>However, inside Markdown code spans and blocks, angle brackets and
+ampersands are <em>always</em> 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 <code>&lt;</code>
+and <code>&amp;</code>in your example code needs to be escaped.)</p>
<hr />
-
-<h2 id="block">Block Elements</h2>
-
-<h3 id="p">Paragraphs and Line Breaks</h3>
-
+<p><h2 id="block">Block Elements</h2></p>
+<p><h3 id="p">Paragraphs and Line Breaks</h3></p>
<p>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.
-</p>
+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.</p>
<p>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 <code>&lt;br /&gt;</code> tag.
-</p>
-<p>When you <em>do</em> want to insert a <code>&lt;br /&gt;</code> break tag using Markdown, you
- end a line with two or more spaces, then type return.
-</p>
+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 <code>&lt;br /&gt;</code>tag.</p>
+<p>When you <em>do</em> want to insert a <code>&lt;br /&gt;</code>break tag using Markdown, you
+end a line with two or more spaces, then type return.</p>
<p>Yes, this takes a tad more effort to create a <code>&lt;br /&gt;</code>, but a simplistic
- "every line break is a <code>&lt;br /&gt;</code>" rule wouldn't work for Markdown.
- Markdown's email-style <a href="#blockquote">blockquoting</a> and multi-paragraph <a href="#list">list items</a>
- work best -- and look better -- when you format them with hard breaks.
-</p>
-<h3 id="header">Headers</h3>
-
-<p>Markdown supports two styles of headers, <a href="http://docutils.sourceforge.net/mirror/setext.html">Setext</a> and <a href="http://www.aaronsw.com/2002/atx/">atx</a>.
-</p>
+"every line break is a <code>&lt;br /&gt;</code>" rule wouldn't work for Markdown.
+Markdown's email-style <a href="#blockquote">blockquoting</a> and multi-paragraph <a href="#list">list items</a>work best -- and look better -- when you format them with hard breaks.</p>
+<p><h3 id="header">Headers</h3></p>
+<p>Markdown supports two styles of headers, <a href="http://docutils.sourceforge.net/mirror/setext.html">Setext</a>and <a href="http://www.aaronsw.com/2002/atx/">atx</a>.</p>
<p>Setext-style headers are "underlined" using equal signs (for first-level
- headers) and dashes (for second-level headers). For example:
-</p>
-<pre><code>This is an H1
+headers) and dashes (for second-level headers). For example:</p>
+<pre>
+<code>This is an H1
=============
This is an H2
-------------
-</code></pre><p>Any number of underlining <code>=</code>'s or <code>-</code>'s will work.
-</p>
+</code>
+</pre>
+<p>Any number of underlining <code>=</code>'s or <code>-</code>'s will work.</p>
<p>Atx-style headers use 1-6 hash characters at the start of the line,
- corresponding to header levels 1-6. For example:
-</p>
-<pre><code># This is an H1
+corresponding to header levels 1-6. For example:</p>
+<pre>
+<code># This is an H1
## This is an H2
###### This is an H6
-</code></pre><p>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.) :
-</p>
-<pre><code># This is an H1 #
+</code>
+</pre>
+<p>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.) :</p>
+<pre>
+<code># This is an H1 #
## This is an H2 ##
### This is an H3 ######
-</code></pre><h3 id="blockquote">Blockquotes</h3>
-
+</code>
+</pre>
+<p><h3 id="blockquote">Blockquotes</h3></p>
<p>Markdown uses email-style <code>&gt;</code> 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 <code>&gt;</code> before every line:
-</p>
-<pre><code>&gt; This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
+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 <code>&gt;</code>before every line:</p>
+<pre>
+<code>&gt; This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
&gt; consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
&gt; Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
&gt;
&gt; Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
&gt; id sem consectetuer libero luctus adipiscing.
-</code></pre><p>Markdown allows you to be lazy and only put the <code>&gt;</code> before the first
- line of a hard-wrapped paragraph:
-</p>
-<pre><code>&gt; This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
+</code>
+</pre>
+<p>Markdown allows you to be lazy and only put the <code>&gt;</code>before the first
+line of a hard-wrapped paragraph:</p>
+<pre>
+<code>&gt; 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.
&gt; Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
id sem consectetuer libero luctus adipiscing.
-</code></pre><p>Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by
- adding additional levels of <code>&gt;</code>:
-</p>
-<pre><code>&gt; This is the first level of quoting.
+</code>
+</pre>
+<p>Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by
+adding additional levels of <code>&gt;</code>:</p>
+<pre>
+<code>&gt; This is the first level of quoting.
&gt;
&gt; &gt; This is nested blockquote.
&gt;
&gt; Back to the first level.
-</code></pre><p>Blockquotes can contain other Markdown elements, including headers, lists,
- and code blocks:
-</p>
-<pre><code>&gt; ## This is a header.
+</code>
+</pre>
+<p>Blockquotes can contain other Markdown elements, including headers, lists,
+and code blocks:</p>
+<pre>
+<code>&gt; ## This is a header.
&gt;
&gt; 1. This is the first list item.
&gt; 2. This is the second list item.
@@ -291,108 +291,130 @@ id sem consectetuer libero luctus adipiscing.
&gt; Here's some example code:
&gt;
&gt; return shell_exec("echo $input | $markdown_script");
-</code></pre><p>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.
-</p>
-<h3 id="list">Lists</h3>
-
-<p>Markdown supports ordered (numbered) and unordered (bulleted) lists.
-</p>
+</code>
+</pre>
+<p>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.</p>
+<p><h3 id="list">Lists</h3></p>
+<p>Markdown supports ordered (numbered) and unordered (bulleted) lists.</p>
<p>Unordered lists use asterisks, pluses, and hyphens -- interchangably
- -- as list markers:
-</p>
-<pre><code>* Red
+-- as list markers:</p>
+<pre>
+<code>* Red
* Green
* Blue
-</code></pre><p>is equivalent to:
-</p>
-<pre><code>+ Red
+</code>
+</pre>
+<p>is equivalent to:</p>
+<pre>
+<code>+ Red
+ Green
+ Blue
-</code></pre><p>and:
-</p>
-<pre><code>- Red
+</code>
+</pre>
+<p>and:</p>
+<pre>
+<code>- Red
- Green
- Blue
-</code></pre><p>Ordered lists use numbers followed by periods:
-</p>
-<pre><code>1. Bird
+</code>
+</pre>
+<p>Ordered lists use numbers followed by periods:</p>
+<pre>
+<code>1. Bird
2. McHale
3. Parish
-</code></pre><p>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:
-</p>
-<pre><code>&lt;ol&gt;
+</code>
+</pre>
+<p>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:</p>
+<pre>
+<code>&lt;ol&gt;
&lt;li&gt;Bird&lt;/li&gt;
&lt;li&gt;McHale&lt;/li&gt;
&lt;li&gt;Parish&lt;/li&gt;
&lt;/ol&gt;
-</code></pre><p>If you instead wrote the list in Markdown like this:
-</p>
-<pre><code>1. Bird
+</code>
+</pre>
+<p>If you instead wrote the list in Markdown like this:</p>
+<pre>
+<code>1. Bird
1. McHale
1. Parish
-</code></pre><p>or even:
-</p>
-<pre><code>3. Bird
+</code>
+</pre>
+<p>or even:</p>
+<pre>
+<code>3. Bird
1. McHale
8. Parish
-</code></pre><p>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.
-</p>
+</code>
+</pre>
+<p>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.</p>
<p>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.
-</p>
+list with the number 1. At some point in the future, Markdown may support
+starting ordered lists at an arbitrary number.</p>
<p>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.
-</p>
-<p>To make lists look nice, you can wrap items with hanging indents:
-</p>
-<pre><code>* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
+up to three spaces. List markers must be followed by one or more spaces
+or a tab.</p>
+<p>To make lists look nice, you can wrap items with hanging indents:</p>
+<pre>
+<code>* 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.
-</code></pre><p>But if you want to be lazy, you don't have to:
-</p>
-<pre><code>* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
+</code>
+</pre>
+<p>But if you want to be lazy, you don't have to:</p>
+<pre>
+<code>* 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.
-</code></pre><p>If list items are separated by blank lines, Markdown will wrap the
- items in <code>&lt;p&gt;</code> tags in the HTML output. For example, this input:
-</p>
-<pre><code>* Bird
+</code>
+</pre>
+<p>If list items are separated by blank lines, Markdown will wrap the
+items in <code>&lt;p&gt;</code>tags in the HTML output. For example, this input:</p>
+<pre>
+<code>* Bird
* Magic
-</code></pre><p>will turn into:
-</p>
-<pre><code>&lt;ul&gt;
+</code>
+</pre>
+<p>will turn into:</p>
+<pre>
+<code>&lt;ul&gt;
&lt;li&gt;Bird&lt;/li&gt;
&lt;li&gt;Magic&lt;/li&gt;
&lt;/ul&gt;
-</code></pre><p>But this:
-</p>
-<pre><code>* Bird
+</code>
+</pre>
+<p>But this:</p>
+<pre>
+<code>* Bird
* Magic
-</code></pre><p>will turn into:
-</p>
-<pre><code>&lt;ul&gt;
+</code>
+</pre>
+<p>will turn into:</p>
+<pre>
+<code>&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Bird&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Magic&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
-</code></pre><p>List items may consist of multiple paragraphs. Each subsequent
- paragraph in a list item must be intended by either 4 spaces
- or one tab:
-</p>
-<pre><code>1. This is a list item with two paragraphs. Lorem ipsum dolor
+</code>
+</pre>
+<p>List items may consist of multiple paragraphs. Each subsequent
+paragraph in a list item must be intended by either 4 spaces
+or one tab:</p>
+<pre>
+<code>1. This is a list item with two paragraphs. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
mi posuere lectus.
@@ -401,103 +423,122 @@ Suspendisse id sem consectetuer libero luctus adipiscing.
sit amet velit.
2. Suspendisse id sem consectetuer libero luctus adipiscing.
-</code></pre><p>It looks nice if you indent every line of the subsequent
- paragraphs, but here again, Markdown will allow you to be
- lazy:
-</p>
-<pre><code>* This is a list item with two paragraphs.
+</code>
+</pre>
+<p>It looks nice if you indent every line of the subsequent
+paragraphs, but here again, Markdown will allow you to be
+lazy:</p>
+<pre>
+<code>* 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.
-</code></pre><p>To put a blockquote within a list item, the blockquote's <code>&gt;</code>
- delimiters need to be indented:
-</p>
-<pre><code>* A list item with a blockquote:
+</code>
+</pre>
+<p>To put a blockquote within a list item, the blockquote's
+<code>&gt;</code>delimiters need to be indented:</p>
+<pre>
+<code>* A list item with a blockquote:
&gt; This is a blockquote
&gt; inside a list item.
-</code></pre><p>To put a code block within a list item, the code block needs
- to be indented <em>twice</em> -- 8 spaces or two tabs:
-</p>
-<pre><code>* A list item with a code block:
+</code>
+</pre>
+<p>To put a code block within a list item, the code block needs
+to be indented <em>twice</em>-- 8 spaces or two tabs:</p>
+<pre>
+<code>* A list item with a code block:
&lt;code goes here&gt;
-</code></pre><p>It's worth noting that it's possible to trigger an ordered list by
- accident, by writing something like this:
-</p>
-<pre><code>1986. What a great season.
-</code></pre><p>In other words, a <em>number-period-space</em> sequence at the beginning of a
- line. To avoid this, you can backslash-escape the period:
-</p>
-<pre><code>1986\. What a great season.
-</code></pre><h3 id="precode">Code Blocks</h3>
-
+</code>
+</pre>
+<p>It's worth noting that it's possible to trigger an ordered list by
+accident, by writing something like this:</p>
+<pre>
+<code>1986. What a great season.
+</code>
+</pre>
+<p>In other words, a <em>number-period-space</em>sequence at the beginning of a
+line. To avoid this, you can backslash-escape the period:</p>
+<pre>
+<code>1986\. What a great season.
+</code>
+</pre>
+<p><h3 id="precode">Code Blocks</h3></p>
<p>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 <code>&lt;pre&gt;</code> and <code>&lt;code&gt;</code> tags.
-</p>
+markup source code. Rather than forming normal paragraphs, the lines
+of a code block are interpreted literally. Markdown wraps a code block
+in both <code>&lt;pre&gt;</code> and <code>&lt;code&gt;</code>tags.</p>
<p>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:
-</p>
-<pre><code>This is a normal paragraph:
+block by at least 4 spaces or 1 tab. For example, given this input:</p>
+<pre>
+<code>This is a normal paragraph:
This is a code block.
-</code></pre><p>Markdown will generate:
-</p>
-<pre><code>&lt;p&gt;This is a normal paragraph:&lt;/p&gt;
+</code>
+</pre>
+<p>Markdown will generate:</p>
+<pre>
+<code>&lt;p&gt;This is a normal paragraph:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;This is a code block.
&lt;/code&gt;&lt;/pre&gt;
-</code></pre><p>One level of indentation -- 4 spaces or 1 tab -- is removed from each
- line of the code block. For example, this:
-</p>
-<pre><code>Here is an example of AppleScript:
+</code>
+</pre>
+<p>One level of indentation -- 4 spaces or 1 tab -- is removed from each
+line of the code block. For example, this:</p>
+<pre>
+<code>Here is an example of AppleScript:
tell application "Foo"
beep
end tell
-</code></pre><p>will turn into:
-</p>
-<pre><code>&lt;p&gt;Here is an example of AppleScript:&lt;/p&gt;
+</code>
+</pre>
+<p>will turn into:</p>
+<pre>
+<code>&lt;p&gt;Here is an example of AppleScript:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;tell application "Foo"
beep
end tell
&lt;/code&gt;&lt;/pre&gt;
-</code></pre><p>A code block continues until it reaches a line that is not indented
- (or the end of the article).
-</p>
+</code>
+</pre>
+<p>A code block continues until it reaches a line that is not indented
+(or the end of the article).</p>
<p>Within a code block, ampersands (<code>&amp;</code>) and angle brackets (<code>&lt;</code> and <code>&gt;</code>)
- 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:
-</p>
-<pre><code> &lt;div class="footer"&gt;
+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:</p>
+<pre>
+<code> &lt;div class="footer"&gt;
&amp;copy; 2004 Foo Corporation
&lt;/div&gt;
-</code></pre><p>will turn into:
-</p>
-<pre><code>&lt;pre&gt;&lt;code&gt;&amp;lt;div class="footer"&amp;gt;
+</code>
+</pre>
+<p>will turn into:</p>
+<pre>
+<code>&lt;pre&gt;&lt;code&gt;&amp;lt;div class="footer"&amp;gt;
&amp;amp;copy; 2004 Foo Corporation
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
-</code></pre><p>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.
-</p>
-<h3 id="hr">Horizontal Rules</h3>
-
+</code>
+</pre>
+<p>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.</p>
+<p><h3 id="hr">Horizontal Rules</h3></p>
<p>You can produce a horizontal rule tag (<code>&lt;hr /&gt;</code>) 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:
-</p>
-<pre><code>* * *
+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:</p>
+<pre>
+<code>* * *
***
@@ -508,317 +549,347 @@ end tell
---------------------------------------
_ _ _
-</code></pre><hr />
-
-<h2 id="span">Span Elements</h2>
-
-<h3 id="link">Links</h3>
-
-<p>Markdown supports two style of links: <em>inline</em> and <em>reference</em>.
-</p>
-<p>In both styles, the link text is delimited by [square brackets].
-</p>
+</code>
+</pre>
+<hr />
+<p><h2 id="span">Span Elements</h2></p>
+<p><h3 id="link">Links</h3></p>
+<p>Markdown supports two style of links: <em>inline</em> and <em>reference</em>.</p>
+<p>In both styles, the link text is delimited by [square brackets].</p>
<p>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 <em>optional</em>
- title for the link, surrounded in quotes. For example:
-</p>
-<pre><code>This is [an example](http://example.com/ "Title") inline link.
+after the link text's closing square bracket. Inside the parentheses,
+put the URL where you want the link to point, along with an <em>optional</em>title for the link, surrounded in quotes. For example:</p>
+<pre>
+<code>This is [an example](http://example.com/ "Title") inline link.
[This link](http://example.net/) has no title attribute.
-</code></pre><p>Will produce:
-</p>
-<pre><code>&lt;p&gt;This is &lt;a href="http://example.com/" title="Title"&gt;
+</code>
+</pre>
+<p>Will produce:</p>
+<pre>
+<code>&lt;p&gt;This is &lt;a href="http://example.com/" title="Title"&gt;
an example&lt;/a&gt; inline link.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://example.net/"&gt;This link&lt;/a&gt; has no
title attribute.&lt;/p&gt;
-</code></pre><p>If you're referring to a local resource on the same server, you can
- use relative paths:
-</p>
-<pre><code>See my [About](/about/) page for details.
-</code></pre><p>Reference-style links use a second set of square brackets, inside
- which you place a label of your choosing to identify the link:
-</p>
-<pre><code>This is [an example][id] reference-style link.
-</code></pre><p>You can optionally use a space to separate the sets of brackets:
-</p>
-<pre><code>This is [an example] [id] reference-style link.
-</code></pre><p>Then, anywhere in the document, you define your link label like this,
- on a line by itself:
-</p>
-<pre><code>[id]: http://example.com/ "Optional Title Here"
-</code></pre><p>That is:
-</p>
+</code>
+</pre>
+<p>If you're referring to a local resource on the same server, you can
+use relative paths:</p>
+<pre>
+<code>See my [About](/about/) page for details.
+</code>
+</pre>
+<p>Reference-style links use a second set of square brackets, inside
+which you place a label of your choosing to identify the link:</p>
+<pre>
+<code>This is [an example][id] reference-style link.
+</code>
+</pre>
+<p>You can optionally use a space to separate the sets of brackets:</p>
+<pre>
+<code>This is [an example] [id] reference-style link.
+</code>
+</pre>
+<p>Then, anywhere in the document, you define your link label like this,
+on a line by itself:</p>
+<pre>
+<code>[id]: http://example.com/ "Optional Title Here"
+</code>
+</pre>
+<p>That is:</p>
<ul>
- <li>
- Square brackets containing the link identifier (optionally
- indented from the left margin using up to three spaces);
- </li>
-
- <li>
- followed by a colon;
- </li>
-
- <li>
- followed by one or more spaces (or tabs);
- </li>
-
- <li>
- followed by the URL for the link;
- </li>
-
- <li>
- optionally followed by a title attribute for the link, enclosed
- in double or single quotes.
- </li>
+<li>Square brackets containing the link identifier (optionally
+indented from the left margin using up to three spaces);</li>
+<li>followed by a colon;</li>
+<li>followed by one or more spaces (or tabs);</li>
+<li>followed by the URL for the link;</li>
+<li>optionally followed by a title attribute for the link, enclosed
+in double or single quotes.</li>
</ul>
-<p>The link URL may, optionally, be surrounded by angle brackets:
-</p>
-<pre><code>[id]: &lt;http://example.com/&gt; "Optional Title Here"
-</code></pre><p>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:
-</p>
-<pre><code>[id]: http://example.com/longish/path/to/resource/here
+<p>The link URL may, optionally, be surrounded by angle brackets:</p>
+<pre>
+<code>[id]: &lt;http://example.com/&gt; "Optional Title Here"
+</code>
+</pre>
+<p>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:</p>
+<pre>
+<code>[id]: http://example.com/longish/path/to/resource/here
"Optional Title Here"
-</code></pre><p>Link definitions are only used for creating links during Markdown
- processing, and are stripped from your document in the HTML output.
-</p>
-<p>Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are <em>not</em> case sensitive. E.g. these two links:
-</p>
-<pre><code>[link text][a]
+</code>
+</pre>
+<p>Link definitions are only used for creating links during Markdown
+processing, and are stripped from your document in the HTML output.</p>
+<p>Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are <em>not</em>case sensitive. E.g. these two links:</p>
+<pre>
+<code>[link text][a]
[link text][A]
-</code></pre><p>are equivalent.
-</p>
-<p>The <em>implicit link name</em> 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:
-</p>
-<pre><code>[Google][]
-</code></pre><p>And then define the link:
-</p>
-<pre><code>[Google]: http://google.com/
-</code></pre><p>Because link names may contain spaces, this shortcut even works for
- multiple words in the link text:
-</p>
-<pre><code>Visit [Daring Fireball][] for more information.
-</code></pre><p>And then define the link:
-</p>
-<pre><code>[Daring Fireball]: http://daringfireball.net/
-</code></pre><p>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.
-</p>
-<p>Here's an example of reference links in action:
-</p>
-<pre><code>I get 10 times more traffic from [Google] [1] than from
+</code>
+</pre>
+<p>are equivalent.</p>
+<p>The <em>implicit link name</em>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:</p>
+<pre>
+<code>[Google][]
+</code>
+</pre>
+<p>And then define the link:</p>
+<pre>
+<code>[Google]: http://google.com/
+</code>
+</pre>
+<p>Because link names may contain spaces, this shortcut even works for
+multiple words in the link text:</p>
+<pre>
+<code>Visit [Daring Fireball][] for more information.
+</code>
+</pre>
+<p>And then define the link:</p>
+<pre>
+<code>[Daring Fireball]: http://daringfireball.net/
+</code>
+</pre>
+<p>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.</p>
+<p>Here's an example of reference links in action:</p>
+<pre>
+<code>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"
-</code></pre><p>Using the implicit link name shortcut, you could instead write:
-</p>
-<pre><code>I get 10 times more traffic from [Google][] than from
+</code>
+</pre>
+<p>Using the implicit link name shortcut, you could instead write:</p>
+<pre>
+<code>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"
-</code></pre><p>Both of the above examples will produce the following HTML output:
-</p>
-<pre><code>&lt;p&gt;I get 10 times more traffic from &lt;a href="http://google.com/"
+</code>
+</pre>
+<p>Both of the above examples will produce the following HTML output:</p>
+<pre>
+<code>&lt;p&gt;I get 10 times more traffic from &lt;a href="http://google.com/"
title="Google"&gt;Google&lt;/a&gt; than from
&lt;a href="http://search.yahoo.com/" title="Yahoo Search"&gt;Yahoo&lt;/a&gt;
or &lt;a href="http://search.msn.com/" title="MSN Search"&gt;MSN&lt;/a&gt;.&lt;/p&gt;
-</code></pre><p>For comparison, here is the same paragraph written using
- Markdown's inline link style:
-</p>
-<pre><code>I get 10 times more traffic from [Google](http://google.com/ "Google")
+</code>
+</pre>
+<p>For comparison, here is the same paragraph written using
+Markdown's inline link style:</p>
+<pre>
+<code>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").
-</code></pre><p>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.
-</p>
+</code>
+</pre>
+<p>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.</p>
<p>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.
-</p>
-<h3 id="em">Emphasis</h3>
-
+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.</p>
+<p><h3 id="em">Emphasis</h3></p>
<p>Markdown treats asterisks (<code>*</code>) and underscores (<code>_</code>) as indicators of
- emphasis. Text wrapped with one <code>*</code> or <code>_</code> will be wrapped with an
- HTML <code>&lt;em&gt;</code> tag; double <code>*</code>'s or <code>_</code>'s will be wrapped with an HTML
- <code>&lt;strong&gt;</code> tag. E.g., this input:
-</p>
-<pre><code>*single asterisks*
+emphasis. Text wrapped with one <code>*</code> or <code>_</code> will be wrapped with an
+HTML <code>&lt;em&gt;</code> tag; double <code>*</code>'s or <code>_</code>'s will be wrapped with an HTML
+<code>&lt;strong&gt;</code>tag. E.g., this input:</p>
+<pre>
+<code>*single asterisks*
_single underscores_
**double asterisks**
__double underscores__
-</code></pre><p>will produce:
-</p>
-<pre><code>&lt;em&gt;single asterisks&lt;/em&gt;
+</code>
+</pre>
+<p>will produce:</p>
+<pre>
+<code>&lt;em&gt;single asterisks&lt;/em&gt;
&lt;em&gt;single underscores&lt;/em&gt;
&lt;strong&gt;double asterisks&lt;/strong&gt;
&lt;strong&gt;double underscores&lt;/strong&gt;
-</code></pre><p>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.
-</p>
-<p>Emphasis can be used in the middle of a word:
-</p>
-<pre><code>un*fucking*believable
-</code></pre><p>But if you surround an <code>*</code> or <code>_</code> with spaces, it'll be treated as a
- literal asterisk or underscore.
-</p>
+</code>
+</pre>
+<p>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.</p>
+<p>Emphasis can be used in the middle of a word:</p>
+<pre>
+<code>un*fucking*believable
+</code>
+</pre>
+<p>But if you surround an <code>*</code> or <code>_</code>with spaces, it'll be treated as a
+literal asterisk or underscore.</p>
<p>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:
-</p>
-<pre><code>\*this text is surrounded by literal asterisks\*
-</code></pre><h3 id="code">Code</h3>
-
+would otherwise be used as an emphasis delimiter, you can backslash
+escape it:</p>
+<pre>
+<code>\*this text is surrounded by literal asterisks\*
+</code>
+</pre>
+<p><h3 id="code">Code</h3></p>
<p>To indicate a span of code, wrap it with backtick quotes (<code>`</code>).
- Unlike a pre-formatted code block, a code span indicates code within a
- normal paragraph. For example:
-</p>
-<pre><code>Use the `printf()` function.
-</code></pre><p>will produce:
-</p>
-<pre><code>&lt;p&gt;Use the &lt;code&gt;printf()&lt;/code&gt; function.&lt;/p&gt;
-</code></pre><p>To include a literal backtick character within a code span, you can use
- multiple backticks as the opening and closing delimiters:
-</p>
-<pre><code>``There is a literal backtick (`) here.``
-</code></pre><p>which will produce this:
-</p>
-<pre><code>&lt;p&gt;&lt;code&gt;There is a literal backtick (`) here.&lt;/code&gt;&lt;/p&gt;
-</code></pre><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:
-</p>
-<pre><code>A single backtick in a code span: `` ` ``
+Unlike a pre-formatted code block, a code span indicates code within a
+normal paragraph. For example:</p>
+<pre>
+<code>Use the `printf()` function.
+</code>
+</pre>
+<p>will produce:</p>
+<pre>
+<code>&lt;p&gt;Use the &lt;code&gt;printf()&lt;/code&gt; function.&lt;/p&gt;
+</code>
+</pre>
+<p>To include a literal backtick character within a code span, you can use
+multiple backticks as the opening and closing delimiters:</p>
+<pre>
+<code>``There is a literal backtick (`) here.``
+</code>
+</pre>
+<p>which will produce this:</p>
+<pre>
+<code>&lt;p&gt;&lt;code&gt;There is a literal backtick (`) here.&lt;/code&gt;&lt;/p&gt;
+</code>
+</pre>
+<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:</p>
+<pre>
+<code>A single backtick in a code span: `` ` ``
A backtick-delimited string in a code span: `` `foo` ``
-</code></pre><p>will produce:
-</p>
-<pre><code>&lt;p&gt;A single backtick in a code span: &lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
+</code>
+</pre>
+<p>will produce:</p>
+<pre>
+<code>&lt;p&gt;A single backtick in a code span: &lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;A backtick-delimited string in a code span: &lt;code&gt;`foo`&lt;/code&gt;&lt;/p&gt;
-</code></pre><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:
-</p>
-<pre><code>Please don't use any `&lt;blink&gt;` tags.
-</code></pre><p>into:
-</p>
-<pre><code>&lt;p&gt;Please don't use any &lt;code&gt;&amp;lt;blink&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;
-</code></pre><p>You can write this:
-</p>
-<pre><code>`&amp;#8212;` is the decimal-encoded equivalent of `&amp;mdash;`.
-</code></pre><p>to produce:
-</p>
-<pre><code>&lt;p&gt;&lt;code&gt;&amp;amp;#8212;&lt;/code&gt; is the decimal-encoded
+</code>
+</pre>
+<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:</p>
+<pre>
+<code>Please don't use any `&lt;blink&gt;` tags.
+</code>
+</pre>
+<p>into:</p>
+<pre>
+<code>&lt;p&gt;Please don't use any &lt;code&gt;&amp;lt;blink&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;
+</code>
+</pre>
+<p>You can write this:</p>
+<pre>
+<code>`&amp;#8212;` is the decimal-encoded equivalent of `&amp;mdash;`.
+</code>
+</pre>
+<p>to produce:</p>
+<pre>
+<code>&lt;p&gt;&lt;code&gt;&amp;amp;#8212;&lt;/code&gt; is the decimal-encoded
equivalent of &lt;code&gt;&amp;amp;mdash;&lt;/code&gt;.&lt;/p&gt;
-</code></pre><h3 id="img">Images</h3>
-
+</code>
+</pre>
+<p><h3 id="img">Images</h3></p>
<p>Admittedly, it's fairly difficult to devise a "natural" syntax for
- placing images into a plain text document format.
-</p>
+placing images into a plain text document format.</p>
<p>Markdown uses an image syntax that is intended to resemble the syntax
- for links, allowing for two styles: <em>inline</em> and <em>reference</em>.
-</p>
-<p>Inline image syntax looks like this:
-</p>
-<pre><code>![Alt text](/path/to/img.jpg)
+for links, allowing for two styles: <em>inline</em> and <em>reference</em>.</p>
+<p>Inline image syntax looks like this:</p>
+<pre>
+<code>![Alt text](/path/to/img.jpg)
![Alt text](/path/to/img.jpg "Optional title")
-</code></pre><p>That is:
-</p>
+</code>
+</pre>
+<p>That is:</p>
<ul>
- <li>
- An exclamation mark: <code>!</code>;
- </li>
-
- <li>
- followed by a set of square brackets, containing the <code>alt</code>
-attribute text for the image;
- </li>
-
- <li>
- followed by a set of parentheses, containing the URL or path to
- the image, and an optional <code>title</code> attribute enclosed in double
-or single quotes.
- </li>
+<li>An exclamation mark: <code>!</code>;</li>
+<li>followed by a set of square brackets, containing the <code>alt</code>attribute text for the image;</li>
+<li>followed by a set of parentheses, containing the URL or path to
+the image, and an optional <code>title</code>attribute enclosed in double
+or single quotes.</li>
</ul>
-<p>Reference-style image syntax looks like this:
-</p>
-<pre><code>![Alt text][id]
-</code></pre><p>Where "id" is the name of a defined image reference. Image references
- are defined using syntax identical to link references:
-</p>
-<pre><code>[id]: url/to/image "Optional title attribute"
-</code></pre><p>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 <code>&lt;img&gt;</code> tags.
-</p>
+<p>Reference-style image syntax looks like this:</p>
+<pre>
+<code>![Alt text][id]
+</code>
+</pre>
+<p>Where "id" is the name of a defined image reference. Image references
+are defined using syntax identical to link references:</p>
+<pre>
+<code>[id]: url/to/image "Optional title attribute"
+</code>
+</pre>
+<p>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 <code>&lt;img&gt;</code>tags.</p>
<hr />
-
-<h2 id="misc">Miscellaneous</h2>
-
-<h3 id="autolink">Automatic Links</h3>
-
-<p>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:
-</p>
-<pre><code>&lt;http://example.com/&gt;
-</code></pre><p>Markdown will turn this into:
-</p>
-<pre><code>&lt;a href="http://example.com/"&gt;http://example.com/&lt;/a&gt;
-</code></pre><p>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:
-</p>
-<pre><code>&lt;address@example.com&gt;
-</code></pre><p>into something like this:
-</p>
-<pre><code>&lt;a href="&amp;#x6D;&amp;#x61;i&amp;#x6C;&amp;#x74;&amp;#x6F;:&amp;#x61;&amp;#x64;&amp;#x64;&amp;#x72;&amp;#x65;
+<p><h2 id="misc">Miscellaneous</h2></p>
+<p><h3 id="autolink">Automatic Links</h3></p>
+<p>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:</p>
+<pre>
+<code>&lt;http://example.com/&gt;
+</code>
+</pre>
+<p>Markdown will turn this into:</p>
+<pre>
+<code>&lt;a href="http://example.com/"&gt;http://example.com/&lt;/a&gt;
+</code>
+</pre>
+<p>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:</p>
+<pre>
+<code>&lt;address@example.com&gt;
+</code>
+</pre>
+<p>into something like this:</p>
+<pre>
+<code>&lt;a href="&amp;#x6D;&amp;#x61;i&amp;#x6C;&amp;#x74;&amp;#x6F;:&amp;#x61;&amp;#x64;&amp;#x64;&amp;#x72;&amp;#x65;
&amp;#115;&amp;#115;&amp;#64;&amp;#101;&amp;#120;&amp;#x61;&amp;#109;&amp;#x70;&amp;#x6C;e&amp;#x2E;&amp;#99;&amp;#111;
&amp;#109;"&gt;&amp;#x61;&amp;#x64;&amp;#x64;&amp;#x72;&amp;#x65;&amp;#115;&amp;#115;&amp;#64;&amp;#101;&amp;#120;&amp;#x61;
&amp;#109;&amp;#x70;&amp;#x6C;e&amp;#x2E;&amp;#99;&amp;#111;&amp;#109;&lt;/a&gt;
-</code></pre><p>which will render in a browser as a clickable link to "address@example.com".
-</p>
+</code>
+</pre>
+<p>which will render in a browser as a clickable link to "address@example.com".</p>
<p>(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.)
-</p>
-<h3 id="backslash">Backslash Escapes</h3>
-
+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.)</p>
+<p><h3 id="backslash">Backslash Escapes</h3></p>
<p>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 <code>&lt;em&gt;</code> tag), you can backslashes
- before the asterisks, like this:
-</p>
-<pre><code>\*literal asterisks\*
-</code></pre><p>Markdown provides backslash escapes for the following characters:
-</p>
-<pre><code>\ backslash
+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 <code>&lt;em&gt;</code>tag), you can backslashes
+before the asterisks, like this:</p>
+<pre>
+<code>\*literal asterisks\*
+</code>
+</pre>
+<p>Markdown provides backslash escapes for the following characters:</p>
+<pre>
+<code>\ backslash
` backtick
* asterisk
_ underscore
@@ -830,4 +901,5 @@ _ underscore
- minus sign (hyphen)
. dot
! exclamation mark
-</code></pre>
+</code>
+</pre>
diff --git a/tests/markdown-test/nested-blockquotes.html b/tests/markdown-test/nested-blockquotes.html
index 7a94df2..f1b017e 100644
--- a/tests/markdown-test/nested-blockquotes.html
+++ b/tests/markdown-test/nested-blockquotes.html
@@ -1,9 +1,7 @@
-
-<blockquote><p>foo
-</p>
-<blockquote><p>bar
-</p>
-</blockquote><p>foo
-</p>
+<blockquote>
+<p>foo</p>
+<blockquote>
+<p>bar</p>
</blockquote>
-
+<p>foo</p>
+</blockquote> \ No newline at end of file
diff --git a/tests/markdown-test/ordered-and-unordered-list.html b/tests/markdown-test/ordered-and-unordered-list.html
index 928f094..e96cdba 100644
--- a/tests/markdown-test/ordered-and-unordered-list.html
+++ b/tests/markdown-test/ordered-and-unordered-list.html
@@ -1,273 +1,146 @@
-
-
<h2>Unordered</h2>
-<p>Asterisks tight:
-</p>
+<p>Asterisks tight:</p>
<ul>
- <li>
- asterisk 1
- </li>
-
- <li>
- asterisk 2
- </li>
-
- <li>
- asterisk 3
- </li>
+<li>asterisk 1</li>
+<li>asterisk 2</li>
+<li>asterisk 3</li>
</ul>
-<p>Asterisks loose:
-</p>
+<p>Asterisks loose:</p>
<ul>
- <li><p>asterisk 1
-</p>
-
- </li>
-
- <li><p>asterisk 2
-</p>
-
- </li>
-
- <li><p>asterisk 3
-</p>
-
- </li>
+<li>
+<p>asterisk 1</p>
+</li>
+<li>
+<p>asterisk 2</p>
+</li>
+<li>
+<p>asterisk 3</p>
+</li>
</ul>
<hr />
-
-<p>Pluses tight:
-</p>
+<p>Pluses tight:</p>
<ul>
- <li>
- Plus 1
- </li>
-
- <li>
- Plus 2
- </li>
-
- <li>
- Plus 3
- </li>
+<li>Plus 1</li>
+<li>Plus 2</li>
+<li>Plus 3</li>
</ul>
-<p>Pluses loose:
-</p>
+<p>Pluses loose:</p>
<ul>
- <li><p>Plus 1
-</p>
-
- </li>
-
- <li><p>Plus 2
-</p>
-
- </li>
-
- <li><p>Plus 3
-</p>
-
- </li>
+<li>
+<p>Plus 1</p>
+</li>
+<li>
+<p>Plus 2</p>
+</li>
+<li>
+<p>Plus 3</p>
+</li>
</ul>
<hr />
-
-<p>Minuses tight:
-</p>
+<p>Minuses tight:</p>
<ul>
- <li>
- Minus 1
- </li>
-
- <li>
- Minus 2
- </li>
-
- <li>
- Minus 3
- </li>
+<li>Minus 1</li>
+<li>Minus 2</li>
+<li>Minus 3</li>
</ul>
-<p>Minuses loose:
-</p>
+<p>Minuses loose:</p>
<ul>
- <li><p>Minus 1
-</p>
-
- </li>
-
- <li><p>Minus 2
-</p>
-
- </li>
-
- <li><p>Minus 3
-</p>
-
- </li>
+<li>
+<p>Minus 1</p>
+</li>
+<li>
+<p>Minus 2</p>
+</li>
+<li>
+<p>Minus 3</p>
+</li>
</ul>
-
<h2>Ordered</h2>
-<p>Tight:
-</p>
+<p>Tight:</p>
<ol>
- <li>
- First
- </li>
-
- <li>
- Second
- </li>
-
- <li>
- Third
- </li>
+<li>First</li>
+<li>Second</li>
+<li>Third</li>
</ol>
-<p>and:
-</p>
+<p>and:</p>
<ol>
- <li>
- One
- </li>
-
- <li>
- Two
- </li>
-
- <li>
- Three
- </li>
+<li>One</li>
+<li>Two</li>
+<li>Three</li>
</ol>
-<p>Loose using tabs:
-</p>
+<p>Loose using tabs:</p>
<ol>
- <li><p>First
-</p>
-
- </li>
-
- <li><p>Second
-</p>
-
- </li>
-
- <li><p>Third
-</p>
-
- </li>
+<li>
+<p>First</p>
+</li>
+<li>
+<p>Second</p>
+</li>
+<li>
+<p>Third</p>
+</li>
</ol>
-<p>and using spaces:
-</p>
+<p>and using spaces:</p>
<ol>
- <li><p>One
-</p>
-
- </li>
-
- <li><p>Two
-</p>
-
- </li>
-
- <li><p>Three
-</p>
-
- </li>
+<li>
+<p>One</p>
+</li>
+<li>
+<p>Two</p>
+</li>
+<li>
+<p>Three</p>
+</li>
</ol>
-<p>Multiple paragraphs:
-</p>
+<p>Multiple paragraphs:</p>
<ol>
- <li><p>Item 1, graf one.
-</p>
+<li>
+<p>Item 1, graf one.</p>
<p>Item 2. graf two. The quick brown fox jumped over the lazy dog's
- back.
-</p>
-
- </li>
-
- <li><p>Item 2.
-</p>
-
- </li>
-
- <li><p>Item 3.
-</p>
-
- </li>
+back.</p>
+</li>
+<li>
+<p>Item 2.</p>
+</li>
+<li>
+<p>Item 3.</p>
+</li>
</ol>
-
<h2>Nested</h2>
<ul>
- <li>
- Tab<ul>
- <li>
- Tab<ul>
- <li>
- Tab
- </li>
+<li>Tab<ul>
+<li>Tab<ul>
+<li>Tab</li>
</ul>
-
- </li>
+</li>
</ul>
-
- </li>
+</li>
</ul>
-<p>Here's another:
-</p>
+<p>Here's another:</p>
<ol>
- <li>
- First
- </li>
-
- <li>
- Second:<ul>
- <li>
- Fee
- </li>
-
- <li>
- Fie
- </li>
-
- <li>
- Foe
- </li>
+<li>First</li>
+<li>Second:<ul>
+<li>Fee</li>
+<li>Fie</li>
+<li>Foe</li>
</ul>
-
- </li>
-
- <li>
- Third
- </li>
+</li>
+<li>Third</li>
</ol>
-<p>Same thing but with paragraphs:
-</p>
+<p>Same thing but with paragraphs:</p>
<ol>
- <li><p>First
-</p>
-
- </li>
-
- <li><p>Second:
-</p>
+<li>
+<p>First</p>
+</li>
+<li>
+<p>Second:</p>
<ul>
- <li>
- Fee
- </li>
-
- <li>
- Fie
- </li>
-
- <li>
- Foe
- </li>
+<li>Fee</li>
+<li>Fie</li>
+<li>Foe</li>
</ul>
-
- </li>
-
- <li><p>Third
-</p>
-
- </li>
+</li>
+<li>
+<p>Third</p>
+</li>
</ol>
-
-
diff --git a/tests/markdown-test/strong-and-em-together.html b/tests/markdown-test/strong-and-em-together.html
index 7bb56db..8a40b58 100644
--- a/tests/markdown-test/strong-and-em-together.html
+++ b/tests/markdown-test/strong-and-em-together.html
@@ -1,11 +1,16 @@
-
-<p><strong><em>This is strong and em.</em></strong>
+<p>
+<strong>
+<em>This is strong and em.</em>
+</strong>
</p>
-<p>So is <strong><em>this</em></strong> word.
+<p>So is <strong>
+<em>this</em>
+</strong>word.</p>
+<p>
+<strong>
+<em>This is strong and em.</em>
+</strong>
</p>
-<p><strong><em>This is strong and em.</em></strong>
-</p>
-<p>So is <strong><em>this</em></strong> word.
-</p>
-
-
+<p>So is <strong>
+<em>this</em>
+</strong>word.</p> \ No newline at end of file
diff --git a/tests/markdown-test/tabs.html b/tests/markdown-test/tabs.html
index 3c91b64..f90fb95 100644
--- a/tests/markdown-test/tabs.html
+++ b/tests/markdown-test/tabs.html
@@ -1,29 +1,29 @@
-
<ul>
- <li><p>this is a list item
- indented with tabs
-</p>
-
- </li>
-
- <li><p>this is a list item
- indented with spaces
-</p>
-
- </li>
+<li>
+<p>this is a list item
+indented with tabs</p>
+</li>
+<li>
+<p>this is a list item
+indented with spaces</p>
+</li>
</ul>
-<p>Code:
-</p>
-<pre><code>this code block is indented by one tab
-</code></pre><p>And:
-</p>
-<pre><code> this code block is indented by two tabs
-</code></pre><p>And:
-</p>
-<pre><code>+ this is an example list item
+<p>Code:</p>
+<pre>
+<code>this code block is indented by one tab
+</code>
+</pre>
+<p>And:</p>
+<pre>
+<code> this code block is indented by two tabs
+</code>
+</pre>
+<p>And:</p>
+<pre>
+<code>+ this is an example list item
indented with tabs
+ this is an example list item
indented with spaces
-</code></pre>
-
+</code>
+</pre>
diff --git a/tests/markdown-test/tidyness.html b/tests/markdown-test/tidyness.html
index 0431d2d..52b2eaf 100644
--- a/tests/markdown-test/tidyness.html
+++ b/tests/markdown-test/tidyness.html
@@ -1,18 +1,8 @@
-
-<blockquote><p>A list within a blockquote:
-</p>
+<blockquote>
+<p>A list within a blockquote:</p>
<ul>
- <li>
- asterisk 1
- </li>
-
- <li>
- asterisk 2
- </li>
-
- <li>
- asterisk 3
- </li>
+<li>asterisk 1</li>
+<li>asterisk 2</li>
+<li>asterisk 3</li>
</ul>
-</blockquote>
-
+</blockquote> \ No newline at end of file
diff --git a/tests/misc/CRLF_line_ends.html b/tests/misc/CRLF_line_ends.html
index 8e6849f..c650e58 100644
--- a/tests/misc/CRLF_line_ends.html
+++ b/tests/misc/CRLF_line_ends.html
@@ -1,5 +1,4 @@
-<p>foo
-</p>
-<div>
+<p>foo</p>
+<p><div>
bar
-</div> \ No newline at end of file
+</div></p> \ No newline at end of file
diff --git a/tests/misc/adjacent-headers.html b/tests/misc/adjacent-headers.html
index 43ad50c..bd171aa 100644
--- a/tests/misc/adjacent-headers.html
+++ b/tests/misc/adjacent-headers.html
@@ -1,7 +1,2 @@
-
-
<h1>this is a huge header</h1>
-
-<h2>this is a smaller header</h2>
-
-
+<h2>this is a smaller header</h2> \ No newline at end of file
diff --git a/tests/misc/amp-in-url.html b/tests/misc/amp-in-url.html
index f4c1ac5..e0ca599 100644
--- a/tests/misc/amp-in-url.html
+++ b/tests/misc/amp-in-url.html
@@ -1,5 +1,3 @@
-
-<p><a href="http://www.freewisdom.org/this&amp;that">link</a>
-</p>
-
-
+<p>
+<a href="http://www.freewisdom.org/this&amp;that">link</a>
+</p> \ No newline at end of file
diff --git a/tests/misc/ampersand.html b/tests/misc/ampersand.html
index 672ffa5..94ed80c 100644
--- a/tests/misc/ampersand.html
+++ b/tests/misc/ampersand.html
@@ -1,7 +1,2 @@
-
-<p>&amp;
-</p>
-<p>AT&amp;T
-</p>
-
-
+<p>&amp;</p>
+<p>AT&amp;T</p> \ No newline at end of file
diff --git a/tests/misc/arabic.html b/tests/misc/arabic.html
index 8f3e9c6..ab4cc13 100644
--- a/tests/misc/arabic.html
+++ b/tests/misc/arabic.html
@@ -1,18 +1,17 @@
-<h1 dir="rtl">بايثون</h1>
-<p dir="rtl"><strong>بايثون</strong> لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (OOP) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوحة المصدر. صُنفت بالأساس كلغة تفسيرية ، بايثون مصممة أصلاً للأداء بعض المهام الخاصة أو المحدودة. إلا أنه يمكن استخدامها بايثون لإنجاز المشاريع الضخمه كأي لغة برمجية أخرى، غالباً ما يُنصح المبتدئين في ميدان البرمجة بتعلم هذه اللغة لأنها من بين أسهل اللغات البرمجية تعلماً.
-</p>
-<p dir="rtl">نشأت بايثون في مركز CWI (مركز العلوم والحاسب الآلي) بأمستردام على يد جويدو فان رُزوم. تم تطويرها بلغة C. أطلق فان رُزوم اسم "بايثون" على لغته تعبيرًا عن إعجابه بفِرقَة مسرحية هزلية شهيرة من بريطانيا، كانت تطلق على نفسها اسم مونتي بايثون Monty Python.
-</p>
-<p dir="rtl">تتميز بايثون بمجتمعها النشط ، كما أن لها الكثير من المكتبات البرمجية ذات الأغراض الخاصة والتي برمجها أشخاص من مجتمع هذه اللغة ، مثلاً مكتبة PyGame التي توفر مجموعه من الوظائف من اجل برمجة الالعاب. ويمكن لبايثون التعامل مع العديد من أنواع قواعد البيانات مثل MySQL وغيره.
-</p>
-
-<h2 dir="rtl">أمثلة</h2>
-<p dir="rtl">مثال Hello World!
-</p>
-<pre><code>print "Hello World!"
-</code></pre><p dir="rtl">مثال لاستخراج المضروب Factorial :
-</p>
-<pre><code>num = 1
+<h1>بايثون</h1>
+<p>
+<strong>بايثون</strong>لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (OOP) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوحة المصدر. صُنفت بالأساس كلغة تفسيرية ، بايثون مصممة أصلاً للأداء بعض المهام الخاصة أو المحدودة. إلا أنه يمكن استخدامها بايثون لإنجاز المشاريع الضخمه كأي لغة برمجية أخرى، غالباً ما يُنصح المبتدئين في ميدان البرمجة بتعلم هذه اللغة لأنها من بين أسهل اللغات البرمجية تعلماً.</p>
+<p>نشأت بايثون في مركز CWI (مركز العلوم والحاسب الآلي) بأمستردام على يد جويدو فان رُزوم. تم تطويرها بلغة C. أطلق فان رُزوم اسم "بايثون" على لغته تعبيرًا عن إعجابه بفِرقَة مسرحية هزلية شهيرة من بريطانيا، كانت تطلق على نفسها اسم مونتي بايثون Monty Python.</p>
+<p>تتميز بايثون بمجتمعها النشط ، كما أن لها الكثير من المكتبات البرمجية ذات الأغراض الخاصة والتي برمجها أشخاص من مجتمع هذه اللغة ، مثلاً مكتبة PyGame التي توفر مجموعه من الوظائف من اجل برمجة الالعاب. ويمكن لبايثون التعامل مع العديد من أنواع قواعد البيانات مثل MySQL وغيره.</p>
+<h2>أمثلة</h2>
+<p>مثال Hello World!</p>
+<pre>
+<code>print "Hello World!"
+</code>
+</pre>
+<p>مثال لاستخراج المضروب Factorial :</p>
+<pre>
+<code>num = 1
x = raw_input('Insert the number please ')
x = int(x)
@@ -24,11 +23,12 @@ else:
x = x-1
print num
-</code></pre>
-<h2 dir="rtl">وصلات خارجية</h2>
-<ul dir="rtl">
- <li dir="rtl"><a href="http://www.python.org">الموقع الرسمي للغة بايثون</a>
- </li>
+</code>
+</pre>
+<h2>وصلات خارجية</h2>
+<ul>
+<li>
+<a href="http://www.python.org">الموقع الرسمي للغة بايثون</a>
+</li>
</ul>
-<p dir="rtl"> بذرة حاس
-</p>
+<p>بذرة حاس</p>
diff --git a/tests/misc/attributes2.html b/tests/misc/attributes2.html
index 62cbaca..cc1ae26 100644
--- a/tests/misc/attributes2.html
+++ b/tests/misc/attributes2.html
@@ -1,14 +1,6 @@
-
-<p id="TABLE.OF.CONTENTS">
-</p>
+<p id="TABLE.OF.CONTENTS" />
<ul>
- <li id="TABLEOFCONTENTS">
-
- </li>
+<li id="TABLEOFCONTENTS" />
</ul>
-<p id="TABLEOFCONTENTS">Or in the middle of the text
-</p>
-<p id="tableofcontents">
-</p>
-
-
+<p id="TABLEOFCONTENTS">Or in the middle of the text </p>
+<p id="tableofcontents" />
diff --git a/tests/misc/bidi.html b/tests/misc/bidi.html
index 2b55061..1959181 100644
--- a/tests/misc/bidi.html
+++ b/tests/misc/bidi.html
@@ -1,39 +1,29 @@
-<p><strong>Python</strong>(パイソン)は、<a href="http://en.wikipedia.org/wiki/Guido_van_Rossum">Guido van Rossum</a> によって作られたオープンソースのオブジェクト指向スクリプト言語。<a href="http://ja.wikipedia.org/wiki/Perl">Perl</a>とともに欧米で広く普及している。イギリスのテレビ局 BBC が製作したコメディ番組『空飛ぶモンティ・パイソン』にちなんで名付けられた。 (Pythonには、爬虫類のニシキヘビの意味があり、Python言語のマスコットやアイコンとして使われることがある。)
-</p>
-<p>|||||||||||||||||||||||||||||THIS SHOULD BE LTR|||||||||||||||||||||||||
-</p>
-<p dir="rtl">|||||||||||||||||||||||||||||THIS SHOULD BE RTL|||||||||||||||||||||||||
-</p>
-<p dir="ltr">(<strong>بايثون</strong> لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (THIS SHOULD BE LTR ) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوح
-</p>
-<p dir="rtl">پایتون زبان برنامه‌نویسی تفسیری و سطح بالا ، شی‌گرا و یک زبان برنامه‌نویسی تفسیری سمت سرور قدرتمند است که توسط گیدو ون روسوم در سال ۱۹۹۰ ساخته شد. این زبان در ویژگی‌ها شبیه پرل، روبی، اسکیم، اسمال‌تاک و تی‌سی‌ال است و از مدیریت خودکار حافظه استفاده می‌کند
-</p>
-<p>Python,是一种面向对象的、直譯式的计算机程序设计语言,也是一种功能强大而完善的通用型语言,已经具有十多年的发展历史,成熟且稳定。
-</p>
-<p dir="rtl">ބްލޫ ވޭލްގެ ދޫ މަތީގައި އެއްފަހަރާ 50 މީހުންނަށް ތިބެވިދާނެވެ. ބޮޑު މަހުގެ ދުލަކީ އެހާމެ ބޮޑު އެއްޗެކެވެ.
-</p>
-<p><strong>உருது</strong> 13ஆம் நூற்றாண்டில் உருவான ஒரு இந்தோ-ஐரோப்பிய மொழியாகும். உருது, ஹிந்தியுடன் சேர்த்து "ஹிந்துஸ்தானி" என அழைக்கப்படுகின்றது. மண்டரின், ஆங்கிலம் ஆகியவற்றுக்கு அடுத்தபடியாக மூன்றாவது கூடிய அளவு மக்களால் புரிந்து கொள்ளப்படக்கூடியது ஹிந்துஸ்தானியேயாகும். தாய் மொழியாகப் பேசுபவர்கள் எண்ணிக்கையின் அடிப்படையில் உருது உலகின் 20 ஆவது பெரிய மொழியாகும். 6 கோடி மக்கள் இதனைத் தாய் மொழியாகக் கொண்டுள்ளார்கள். இரண்டாவது மொழியாகக் கொண்டுள்ளவர்கள் உட்பட 11 கோடிப் பேர் இதனைப் பேசுகிறார்கள். உருது பாகிஸ்தானின் அரசகரும மொழியாகவும், இந்தியாவின் அரசகரும மொழிகளுள் ஒன்றாகவும் விளங்குகிறது.
-</p>
-<p dir="rtl">اردو ہندوآریائی زبانوں کی ہندويورپی شاخ کی ایک زبان ہے جو تيرھويں صدی ميں بر صغير ميں پيدا ہوئی ـ اردو پاکستان کی سرکاری زبان ہے اور بھارت کی سرکاری زبانوں ميں سے ايک ہے۔ اردو بھارت ميں 5 کروڑ اور پاکستان ميں 1 کروڑ لوگوں کی مادری زبان ہے مگر اسے بھارت اور پاکستان کے تقریباً 50 کروڑ لوگ بول اور سمجھ سکتے ھیں ۔ جن میں سے تقریباً 10.5 کروڑ لوگ اسے باقاعدہ بولتے ھیں۔
-</p>
-
-<h1 dir="rtl">بايثون</h1>
-<p dir="rtl"><strong>بايثون</strong> لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (OOP) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوحة المصدر. صُنفت بالأساس كلغة تفسيرية ، بايثون مصممة أصلاً للأداء بعض المهام الخاصة أو المحدودة. إلا أنه يمكن استخدامها بايثون لإنجاز المشاريع الضخمه كأي لغة برمجية أخرى، غالباً ما يُنصح المبتدئين في ميدان البرمجة بتعلم هذه اللغة لأنها من بين أسهل اللغات البرمجية تعلماً.
-</p>
-<p dir="rtl">|||||||||||||||||||||||||||||THIS SHOULD BE RTL|||||||||||||||||||||||||
-</p>
-<p dir="rtl">(نشأت بايثون في مركز CWI (مركز العلوم والحاسب الآلي) بأمستردام على يد جويدو فان رُزوم. تم تطويرها بلغة C. أطلق فان رُزوم اسم "بايثون" على لغته تعبيرًا عن إعجابه بفِرقَة مسرحية هزلية شهيرة من بريطانيا، كانت تطلق على نفسها اسم مونتي بايثون Monty Python.
-</p>
-<p dir="rtl">تتميز بايثون بمجتمعها النشط ، كما أن لها الكثير من المكتبات البرمجية ذات الأغراض الخاصة والتي برمجها أشخاص من مجتمع هذه اللغة ، مثلاً مكتبة PyGame التي توفر مجموعه من الوظائف من اجل برمجة الالعاب. ويمكن لبايثون التعامل مع العديد من أنواع قواعد البيانات مثل MySQL وغيره.
-</p>
-
-<h2 dir="rtl">أمثلة</h2>
-<p dir="rtl">مثال Hello World!
-</p>
-<pre><code>print "Hello World!"
-</code></pre><p dir="rtl">مثال لاستخراج المضروب Factorial :
-</p>
-<pre><code>num = 1
+<p>
+ <strong>Python</strong>(パイソン)は、<a href="http://en.wikipedia.org/wiki/Guido_van_Rossum">Guido van Rossum</a> によって作られたオープンソースのオブジェクト指向スクリプト言語。<a href="http://ja.wikipedia.org/wiki/Perl">Perl</a>とともに欧米で広く普及している。イギリスのテレビ局 BBC が製作したコメディ番組『空飛ぶモンティ・パイソン』にちなんで名付けられた。 (Pythonには、爬虫類のニシキヘビの意味があり、Python言語のマスコットやアイコンとして使われることがある。)</p>
+<p>|||||||||||||||||||||||||||||THIS SHOULD BE LTR|||||||||||||||||||||||||</p>
+<p dir="rtl">|||||||||||||||||||||||||||||THIS SHOULD BE RTL||||||||||||||||||||||||| </p>
+<p dir="ltr">(<strong>بايثون</strong>لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (THIS SHOULD BE LTR ) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوح</p>
+<p>پایتون زبان برنامه‌نویسی تفسیری و سطح بالا ، شی‌گرا و یک زبان برنامه‌نویسی تفسیری سمت سرور قدرتمند است که توسط گیدو ون روسوم در سال ۱۹۹۰ ساخته شد. این زبان در ویژگی‌ها شبیه پرل، روبی، اسکیم، اسمال‌تاک و تی‌سی‌ال است و از مدیریت خودکار حافظه استفاده می‌کند</p>
+<p>Python,是一种面向对象的、直譯式的计算机程序设计语言,也是一种功能强大而完善的通用型语言,已经具有十多年的发展历史,成熟且稳定。</p>
+<p>ބްލޫ ވޭލްގެ ދޫ މަތީގައި އެއްފަހަރާ 50 މީހުންނަށް ތިބެވިދާނެވެ. ބޮޑު މަހުގެ ދުލަކީ އެހާމެ ބޮޑު އެއްޗެކެވެ.</p>
+<p>
+ <strong>உருது</strong>13ஆம் நூற்றாண்டில் உருவான ஒரு இந்தோ-ஐரோப்பிய மொழியாகும். உருது, ஹிந்தியுடன் சேர்த்து "ஹிந்துஸ்தானி" என அழைக்கப்படுகின்றது. மண்டரின், ஆங்கிலம் ஆகியவற்றுக்கு அடுத்தபடியாக மூன்றாவது கூடிய அளவு மக்களால் புரிந்து கொள்ளப்படக்கூடியது ஹிந்துஸ்தானியேயாகும். தாய் மொழியாகப் பேசுபவர்கள் எண்ணிக்கையின் அடிப்படையில் உருது உலகின் 20 ஆவது பெரிய மொழியாகும். 6 கோடி மக்கள் இதனைத் தாய் மொழியாகக் கொண்டுள்ளார்கள். இரண்டாவது மொழியாகக் கொண்டுள்ளவர்கள் உட்பட 11 கோடிப் பேர் இதனைப் பேசுகிறார்கள். உருது பாகிஸ்தானின் அரசகரும மொழியாகவும், இந்தியாவின் அரசகரும மொழிகளுள் ஒன்றாகவும் விளங்குகிறது.</p>
+<p>اردو ہندوآریائی زبانوں کی ہندويورپی شاخ کی ایک زبان ہے جو تيرھويں صدی ميں بر صغير ميں پيدا ہوئی ـ اردو پاکستان کی سرکاری زبان ہے اور بھارت کی سرکاری زبانوں ميں سے ايک ہے۔ اردو بھارت ميں 5 کروڑ اور پاکستان ميں 1 کروڑ لوگوں کی مادری زبان ہے مگر اسے بھارت اور پاکستان کے تقریباً 50 کروڑ لوگ بول اور سمجھ سکتے ھیں ۔ جن میں سے تقریباً 10.5 کروڑ لوگ اسے باقاعدہ بولتے ھیں۔</p>
+<h1>بايثون</h1>
+<p>
+ <strong>بايثون</strong>لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (OOP) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوحة المصدر. صُنفت بالأساس كلغة تفسيرية ، بايثون مصممة أصلاً للأداء بعض المهام الخاصة أو المحدودة. إلا أنه يمكن استخدامها بايثون لإنجاز المشاريع الضخمه كأي لغة برمجية أخرى، غالباً ما يُنصح المبتدئين في ميدان البرمجة بتعلم هذه اللغة لأنها من بين أسهل اللغات البرمجية تعلماً.</p>
+<p>|||||||||||||||||||||||||||||THIS SHOULD BE RTL|||||||||||||||||||||||||</p>
+<p>(نشأت بايثون في مركز CWI (مركز العلوم والحاسب الآلي) بأمستردام على يد جويدو فان رُزوم. تم تطويرها بلغة C. أطلق فان رُزوم اسم "بايثون" على لغته تعبيرًا عن إعجابه بفِرقَة مسرحية هزلية شهيرة من بريطانيا، كانت تطلق على نفسها اسم مونتي بايثون Monty Python.</p>
+<p>تتميز بايثون بمجتمعها النشط ، كما أن لها الكثير من المكتبات البرمجية ذات الأغراض الخاصة والتي برمجها أشخاص من مجتمع هذه اللغة ، مثلاً مكتبة PyGame التي توفر مجموعه من الوظائف من اجل برمجة الالعاب. ويمكن لبايثون التعامل مع العديد من أنواع قواعد البيانات مثل MySQL وغيره.</p>
+<h2>أمثلة</h2>
+<p>مثال Hello World!</p>
+<pre>
+ <code>print "Hello World!"
+</code>
+</pre>
+<p>مثال لاستخراج المضروب Factorial :</p>
+<pre>
+ <code>num = 1
x = raw_input('Insert the number please ')
x = int(x)
@@ -45,15 +35,17 @@ else:
x = x-1
print num
-</code></pre>
-<h2 dir="rtl">وصلات خارجية</h2>
-<ul dir="rtl">
- <li dir="rtl"><a href="http://www.python.org">الموقع الرسمي للغة بايثون</a>
- </li>
+</code>
+</pre>
+<h2>وصلات خارجية</h2>
+<ul>
+ <li>
+ <a href="http://www.python.org">الموقع الرسمي للغة بايثون</a>
+ </li>
</ul>
-<p dir="rtl"> بذرة حاس
-</p>
-<p><strong>Недвард «Нед» Фландерс</strong> (Nedward «Ned» Flanders) — вымышленный персонаж мультсериала «[Симпсоны][]», озвученный Гарри Ширером. Он и его семья живут по соседству от семьи Симпсонов. Набожный христианин, Нед является одним из столпов морали Спрингфилда. В эпизоде «Alone Again, Natura-Diddily» он овдовел, его жена Мод погибла в результате несчастного случая.
-</p>
+<p>بذرة حاس</p>
+<p>
+ <strong>Недвард «Нед» Фландерс</strong>(Nedward «Ned» Flanders) — вымышленный персонаж мультсериала «[Симпсоны][]», озвученный Гарри Ширером. Он и его семья живут по соседству от семьи Симпсонов. Набожный христианин, Нед является одним из столпов морали Спрингфилда. В эпизоде «Alone Again, Natura-Diddily» он овдовел, его жена Мод погибла в результате несчастного случая.</p>
<p>Нед был одним из первых персонажей в мультсериале, который не был членом семьи Симпсонов. Начиная с первых серий, он регулярно появляется в «Симпсонах». Считается, что Нед Фландерс был назван в честь улицы <em>Northeast Flanders St.</em> в <a href="http://www.portland.gov">Портленде</a>, Орегон, родном городе создателя мультсериала Мэтта Грейнинга]]. Надпись на указателе улицы <em>NE Flanders St.</em> хулиганы часто исправляли на <em>NED Flanders St.</em>
</p>
+
diff --git a/tests/misc/blank-block-quote.html b/tests/misc/blank-block-quote.html
index 1544925..eae7ae0 100644
--- a/tests/misc/blank-block-quote.html
+++ b/tests/misc/blank-block-quote.html
@@ -1,7 +1,3 @@
-
-<p>aaaaaaaaaaa
-</p>
-<blockquote></blockquote><p>bbbbbbbbbbb
-</p>
-
-
+<p>aaaaaaaaaaa</p>
+<blockquote />
+<p>bbbbbbbbbbb</p>
diff --git a/tests/misc/blockquote-hr.html b/tests/misc/blockquote-hr.html
index 1d7af0f..e437766 100644
--- a/tests/misc/blockquote-hr.html
+++ b/tests/misc/blockquote-hr.html
@@ -1,23 +1,16 @@
-<p>This is a paragraph.
-</p>
+<p>This is a paragraph.</p>
<hr />
-
-<blockquote><p>Block quote with horizontal lines.
-</p>
+<blockquote>
+<p>Block quote with horizontal lines.</p>
<hr />
-
-<blockquote><p>Double block quote.
-</p>
+<blockquote>
+<p>Double block quote.</p>
<hr />
-
-<p>End of the double block quote.
-</p>
-</blockquote><p>A new paragraph.
- With multiple lines.
- Even a lazy line.
-</p>
+<p>End of the double block quote.</p>
+</blockquote>
+<p>A new paragraph.
+With multiple lines.
+Even a lazy line.</p>
<hr />
-
-<p>The last line.
-</p>
-</blockquote> \ No newline at end of file
+<p>The last line.</p>
+</blockquote>
diff --git a/tests/misc/blockquote.html b/tests/misc/blockquote.html
index ec16d1f..08289b4 100644
--- a/tests/misc/blockquote.html
+++ b/tests/misc/blockquote.html
@@ -1,22 +1,24 @@
-<blockquote><p>blockquote with no whitespace before <code>&gt;</code>.
-</p>
-</blockquote><p>foo
-</p>
-<blockquote><p>blockquote with one space before the <code>&gt;</code>.
-</p>
-</blockquote><p>bar
-</p>
-<blockquote><p>blockquote with 2 spaces.
-</p>
-</blockquote><p>baz
-</p>
-<p> &gt; this has three spaces so its a paragraph.
-</p>
-<p>blah
-</p>
-<pre><code>&gt; this one had four so it's a code block.
-</code></pre><blockquote><blockquote><p>this nested blockquote has 0 on level one and 3 (one after the first <code>&gt;</code> + 2 more) on level 2.
-</p>
-</blockquote><p> &gt; and this has 4 on level 2 - another code block.
-</p>
+<blockquote>
+<p>blockquote with no whitespace before <code>&gt;</code>.</p>
+</blockquote>
+<p>foo</p>
+<blockquote>
+<p>blockquote with one space before the <code>&gt;</code>.</p>
+</blockquote>
+<p>bar</p>
+<blockquote>
+<p>blockquote with 2 spaces.</p>
+</blockquote>
+<p>baz</p>
+<p>&gt; this has three spaces so its a paragraph.</p>
+<p>blah</p>
+<pre>
+<code>&gt; this one had four so it's a code block.
+</code>
+</pre>
+<blockquote>
+<blockquote>
+<p>this nested blockquote has 0 on level one and 3 (one after the first <code>&gt;</code>+ 2 more) on level 2.</p>
+</blockquote>
+<p>&gt; and this has 4 on level 2 - another code block.</p>
</blockquote> \ No newline at end of file
diff --git a/tests/misc/bold_links.html b/tests/misc/bold_links.html
index 7a1fadb..55dcaa3 100644
--- a/tests/misc/bold_links.html
+++ b/tests/misc/bold_links.html
@@ -1,2 +1,4 @@
-<p><strong>bold <a href="http://example.com">link</a></strong>
-</p>
+<p>
+<strong>bold <a href="http://example.com">link</a>
+</strong>
+</p> \ No newline at end of file
diff --git a/tests/misc/br.html b/tests/misc/br.html
index 6a521e1..52b4796 100644
--- a/tests/misc/br.html
+++ b/tests/misc/br.html
@@ -1,16 +1,13 @@
-
-<p>Output:
-</p>
-<pre><code>&lt;p&gt;Some of these words &lt;em&gt;are emphasized&lt;/em&gt;.
+<p>Output:</p>
+<pre>
+<code>&lt;p&gt;Some of these words &lt;em&gt;are emphasized&lt;/em&gt;.
Some of these words &lt;em&gt;are emphasized also&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Use two asterisks for &lt;strong&gt;strong emphasis&lt;/strong&gt;.
Or, if you prefer, &lt;strong&gt;use two underscores instead&lt;/strong&gt;.&lt;/p&gt;
-</code></pre>
+</code>
+</pre>
<h2>Lists</h2>
<p>Unordered (bulleted) lists use asterisks, pluses, and hyphens (<code>*</code>,
- <code>+</code>, and <code>-</code>) as list markers. These three markers are
- interchangable; this:
-</p>
-
-
+<code>+</code>, and <code>-</code>) as list markers. These three markers are
+interchangable; this:</p> \ No newline at end of file
diff --git a/tests/misc/bracket_re.html b/tests/misc/bracket_re.html
index 04245ad..f48a612 100644
--- a/tests/misc/bracket_re.html
+++ b/tests/misc/bracket_re.html
@@ -1,61 +1,60 @@
<p>[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
-</p> \ No newline at end of file
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx
+xxx xxx xxx xxx xxx xxx xxx xxx</p> \ No newline at end of file
diff --git a/tests/misc/code-first-line.html b/tests/misc/code-first-line.html
index 172b17c..177463f 100644
--- a/tests/misc/code-first-line.html
+++ b/tests/misc/code-first-line.html
@@ -1,2 +1,4 @@
-<pre><code>print "This is a code block."
-</code></pre>
+<pre>
+<code>print "This is a code block."
+</code>
+</pre> \ No newline at end of file
diff --git a/tests/misc/comments.html b/tests/misc/comments.html
index 62b830b..7a03e53 100644
--- a/tests/misc/comments.html
+++ b/tests/misc/comments.html
@@ -1,11 +1,4 @@
-
-<p>X&lt;0
-</p>
-<p>X&gt;0
-</p>
-<!-- A comment -->
-
-<div>as if</div>
-
-
-
+<p>X&lt;0</p>
+<p>X&gt;0</p>
+<p><!-- A comment --></p>
+<p><div>as if</div></p> \ No newline at end of file
diff --git a/tests/misc/div.html b/tests/misc/div.html
index 798024d..634136c 100644
--- a/tests/misc/div.html
+++ b/tests/misc/div.html
@@ -1,9 +1,5 @@
-
-<div id="sidebar">
-
-<p> <em>foo</em>
+<p><div id="sidebar"></p>
+<p>
+<em>foo</em>
</p>
-</div>
-
-
-
+<p></div></p> \ No newline at end of file
diff --git a/tests/misc/email.html b/tests/misc/email.html
index 2fac140..d3bf521 100644
--- a/tests/misc/email.html
+++ b/tests/misc/email.html
@@ -1,6 +1,3 @@
-
<p>asdfasdfadsfasd <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#121;&#117;&#114;&#105;&#64;&#102;&#114;&#101;&#101;&#119;&#105;&#115;&#100;&#111;&#109;&#46;&#111;&#114;&#103;">&#121;&#117;&#114;&#105;&#64;&#102;&#114;&#101;&#101;&#119;&#105;&#115;&#100;&#111;&#109;&#46;&#111;&#114;&#103;</a> or you can say
- instead <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#121;&#117;&#114;&#105;&#64;&#102;&#114;&#101;&#101;&#119;&#105;&#115;&#100;&#111;&#109;&#46;&#111;&#114;&#103;">&#121;&#117;&#114;&#105;&#64;&#102;&#114;&#101;&#101;&#119;&#105;&#115;&#100;&#111;&#109;&#46;&#111;&#114;&#103;</a>
+instead <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#121;&#117;&#114;&#105;&#64;&#102;&#114;&#101;&#101;&#119;&#105;&#115;&#100;&#111;&#109;&#46;&#111;&#114;&#103;">&#121;&#117;&#114;&#105;&#64;&#102;&#114;&#101;&#101;&#119;&#105;&#115;&#100;&#111;&#109;&#46;&#111;&#114;&#103;</a>
</p>
-
-
diff --git a/tests/misc/funky-list.html b/tests/misc/funky-list.html
index ebe8263..a1aa372 100644
--- a/tests/misc/funky-list.html
+++ b/tests/misc/funky-list.html
@@ -1,31 +1,11 @@
-
<ol>
- <li>
- this starts a list <em>with</em> numbers
- </li>
-
- <li>
- this will show as number "2"
- </li>
-
- <li>
- this will show as number "3."
- </li>
-
- <li>
- any number, +, -, or * will keep the list going.
- </li>
+<li>this starts a list <em>with</em>numbers</li>
+<li>this will show as number "2"</li>
+<li>this will show as number "3."</li>
+<li>any number, +, -, or * will keep the list going.</li>
</ol>
-<p>aaaaaaaaaaaaaaa
-</p>
+<p>aaaaaaaaaaaaaaa</p>
<ul>
- <li>
- now a normal list
- </li>
-
- <li>
- and more
- </li>
+<li>now a normal list</li>
+<li>and more</li>
</ul>
-
-
diff --git a/tests/misc/h1.html b/tests/misc/h1.html
index f3110f8..fbf9b4d 100644
--- a/tests/misc/h1.html
+++ b/tests/misc/h1.html
@@ -1,9 +1,3 @@
-
-
<h2>Header</h2>
-
<h1>Header 2</h1>
-
-<h3>H3</h3>
-
-
+<h3>H3</h3> \ No newline at end of file
diff --git a/tests/misc/hash.html b/tests/misc/hash.html
index b78babc..5e8bffb 100644
--- a/tests/misc/hash.html
+++ b/tests/misc/hash.html
@@ -1,18 +1,9 @@
-
-<p>a
-</p>
-<pre>
+<p>a</p>
+<p><pre>
#!/usr/bin/python
-
-hello</pre>
-
-<p>a
-</p>
-<pre>
+hello</pre></p>
+<p>a</p>
+<p><pre>
!/usr/bin/python
-hello</pre>
-
-<p>a
-</p>
-
-
+hello</pre></p>
+<p>a</p> \ No newline at end of file
diff --git a/tests/misc/headers.html b/tests/misc/headers.html
index 7041eda..a65d7b2 100644
--- a/tests/misc/headers.html
+++ b/tests/misc/headers.html
@@ -1,12 +1,9 @@
<h3>Hello world</h3>
<p>Line 2
- Line 3
-</p>
-
+Line 3</p>
<h1>[Markdown][5]</h1>
-
-<h1><a href="http://some.link.com/">Markdown</a></h1>
-
+<h1>
+<a href="http://some.link.com/">Markdown</a>
+</h1>
<h1>[5]: http://foo.com/</h1>
-
-<h1>Issue #1: Markdown</h1>
+<h1>Issue #1: Markdown</h1> \ No newline at end of file
diff --git a/tests/misc/hline.html b/tests/misc/hline.html
index 8d33101..b18a311 100644
--- a/tests/misc/hline.html
+++ b/tests/misc/hline.html
@@ -1,7 +1,2 @@
-
-
<h1>Header</h1>
-<p>Next line
-</p>
-
-
+<p>Next line</p> \ No newline at end of file
diff --git a/tests/misc/html.html b/tests/misc/html.html
index 1209112..81b8b62 100644
--- a/tests/misc/html.html
+++ b/tests/misc/html.html
@@ -1,10 +1,8 @@
-<h1>Block level html</h1>
-
-<p>Some inline <b>stuff<b>.<br />
+<p><h1>Block level html</h1></p>
+<p>Some inline <b>stuff<b>.<br />
</p>
-<p>Now some <arbitrary>arbitrary tags</arbitrary>.
-</p>
-<p>And of course <script>blah</script>.
-</p>
-<p><a href="script&gt;stuff&lt;/script">this <script>link</a>
+<p>Now some <arbitrary>arbitrary tags</arbitrary>.</p>
+<p>And of course <script>blah</script>.</p>
+<p>
+<a href="script&gt;stuff&lt;/script">this <script>link</a>
</p> \ No newline at end of file
diff --git a/tests/misc/image-2.html b/tests/misc/image-2.html
index 79bd7de..bb649e7 100644
--- a/tests/misc/image-2.html
+++ b/tests/misc/image-2.html
@@ -1,7 +1,10 @@
-
-<p><a href="http://src.com/"><em>link!</em></a>
+<p>
+<a href="http://src.com/">
+<em>link!</em>
+</a>
</p>
-<p><em><a href="http://www.freewisdom.org">link</a></em>
-</p>
-
-
+<p>
+<em>
+<a href="http://www.freewisdom.org">link</a>
+</em>
+</p> \ No newline at end of file
diff --git a/tests/misc/image.html b/tests/misc/image.html
index 0f449a5..e87015c 100644
--- a/tests/misc/image.html
+++ b/tests/misc/image.html
@@ -1,5 +1,3 @@
-
-<p><img src="http://humane_man.jpg" title="The most humane man." alt="Poster"/>
+<p>
+<img alt="Poster" src="http://humane_man.jpg" title="The most humane man." />
</p>
-
-
diff --git a/tests/misc/image_in_links.html b/tests/misc/image_in_links.html
index e2027b5..d3edba9 100644
--- a/tests/misc/image_in_links.html
+++ b/tests/misc/image_in_links.html
@@ -1,2 +1,5 @@
-<p><a href="path/to/image.png"><img src="path/to/img_thumb.png" alt="altname"/></a>
-</p> \ No newline at end of file
+<p>
+<a href="path/to/image.png">
+<img alt="altname" src="path/to/img_thumb.png" />
+</a>
+</p>
diff --git a/tests/misc/inside_html.html b/tests/misc/inside_html.html
index 5e128ab..673beac 100644
--- a/tests/misc/inside_html.html
+++ b/tests/misc/inside_html.html
@@ -1,5 +1 @@
-
-<p><a href="stuff"> <strong>ok</strong>? </a>
-</p>
-
-
+<p><a href="stuff"> <strong>ok</strong>? </a></p>
diff --git a/tests/misc/japanese.html b/tests/misc/japanese.html
index c23effd..3fda1c1 100644
--- a/tests/misc/japanese.html
+++ b/tests/misc/japanese.html
@@ -1,28 +1,13 @@
-
-
<h1>パイソン (Python)</h1>
-<p><strong>Python</strong>(パイソン)は、<a href="http://en.wikipedia.org/wiki/Guido_van_Rossum">Guido van Rossum</a> によって作られたオープンソースのオブジェクト指向スクリプト言語。<a href="http://ja.wikipedia.org/wiki/Perl">Perl</a>とともに欧米で広く普及している。イギリスのテレビ局 BBC が製作したコメディ番組『空飛ぶモンティ・パイソン』にちなんで名付けられた。 (Pythonには、爬虫類のニシキヘビの意味があり、Python言語のマスコットやアイコンとして使われることがある。)
-</p>
-
+<p>
+ <strong>Python</strong>(パイソン)は、<a href="http://en.wikipedia.org/wiki/Guido_van_Rossum">Guido van Rossum</a> によって作られたオープンソースのオブジェクト指向スクリプト言語。<a href="http://ja.wikipedia.org/wiki/Perl">Perl</a>とともに欧米で広く普及している。イギリスのテレビ局 BBC が製作したコメディ番組『空飛ぶモンティ・パイソン』にちなんで名付けられた。 (Pythonには、爬虫類のニシキヘビの意味があり、Python言語のマスコットやアイコンとして使われることがある。)</p>
<h2>概要</h2>
-<p>プログラミング言語 Python は初心者から専門家まで幅広いユーザ層を獲得している。利用目的は汎用で、方向性としてはJavaに近い。ただし、最初からネットワーク利用をメインとして考えられているJavaよりセキュリティについてはやや寛大である。多くのプラットフォームをサポートしており(⇒<a href="#somelink">動作するプラットフォーム</a>)、豊富なライブラリがあることから、産業界でも利用が増えつつある。また、Pythonは純粋なプログラミング言語のほかにも、多くの異なる言語で書かれたモジュールをまとめる糊言語のひとつとして位置づけることができる。実際Pythonは多くの商用アプリケーションでスクリプト言語として採用されている(⇒Pythonを使っている製品あるいはソフトウェアの一覧)。豊富なドキュメントをもち、Unicodeによる文字列操作をサポートしており、日本語処理も標準で可能である。
-</p>
-<p>Python は基本的にインタプリタ上で実行されることを念頭において設計されており、以下のような特徴をもっている:
-</p>
+<p>プログラミング言語 Python は初心者から専門家まで幅広いユーザ層を獲得している。利用目的は汎用で、方向性としてはJavaに近い。ただし、最初からネットワーク利用をメインとして考えられているJavaよりセキュリティについてはやや寛大である。多くのプラットフォームをサポートしており(⇒<a href="#somelink">動作するプラットフォーム</a>)、豊富なライブラリがあることから、産業界でも利用が増えつつある。また、Pythonは純粋なプログラミング言語のほかにも、多くの異なる言語で書かれたモジュールをまとめる糊言語のひとつとして位置づけることができる。実際Pythonは多くの商用アプリケーションでスクリプト言語として採用されている(⇒Pythonを使っている製品あるいはソフトウェアの一覧)。豊富なドキュメントをもち、Unicodeによる文字列操作をサポートしており、日本語処理も標準で可能である。</p>
+<p>Python は基本的にインタプリタ上で実行されることを念頭において設計されており、以下のような特徴をもっている:</p>
<ul>
- <li>
- 動的な型付け。
- </li>
-
- <li>
- オブジェクトのメンバに対するアクセスが制限されていない。(属性や専用のメソッドフックを実装することによって制限は可能。)
- </li>
-
- <li>
- モジュール、クラス、オブジェクト等の言語の要素が内部からアクセス可能であり、リフレクションを利用した記述が可能。
- </li>
+ <li>動的な型付け。</li>
+ <li>オブジェクトのメンバに対するアクセスが制限されていない。(属性や専用のメソッドフックを実装することによって制限は可能。)</li>
+ <li>モジュール、クラス、オブジェクト等の言語の要素が内部からアクセス可能であり、リフレクションを利用した記述が可能。</li>
</ul>
-<p>また、Pythonではインデントによりブロックを指定する構文を採用している(⇒<a href="#jklj">オフサイドルール</a>)。この構文はPythonに慣れたユーザからは称賛をもって受け入れられているが、他の言語のユーザからは批判も多い。このほかにも、大きすぎる実行ファイルや、Javaに比べて遅い処理速度などが欠点として指摘されている。しかし <strong>プロトタイピング</strong> の際にはこれらの点はさして問題とはならないことから、研究開発部門では頻繁に利用されている。
-</p>
-
+<p>また、Pythonではインデントによりブロックを指定する構文を採用している(⇒<a href="#jklj">オフサイドルール</a>)。この構文はPythonに慣れたユーザからは称賛をもって受け入れられているが、他の言語のユーザからは批判も多い。このほかにも、大きすぎる実行ファイルや、Javaに比べて遅い処理速度などが欠点として指摘されている。しかし <strong>プロトタイピング</strong>の際にはこれらの点はさして問題とはならないことから、研究開発部門では頻繁に利用されている。</p>
diff --git a/tests/misc/lazy-block-quote.html b/tests/misc/lazy-block-quote.html
index 14da987..7a88263 100644
--- a/tests/misc/lazy-block-quote.html
+++ b/tests/misc/lazy-block-quote.html
@@ -1,9 +1,6 @@
-
-<blockquote><p>Line one of lazy block quote.
- Line two of lazy block quote.
-</p>
+<blockquote>
+<p>Line one of lazy block quote.
+Line two of lazy block quote.</p>
<p>Line one of paragraph two.
- Line two of paragraph two.
-</p>
-</blockquote>
-
+Line two of paragraph two.</p>
+</blockquote> \ No newline at end of file
diff --git a/tests/misc/lists.html b/tests/misc/lists.html
index fa4be24..bf4a02b 100644
--- a/tests/misc/lists.html
+++ b/tests/misc/lists.html
@@ -1,64 +1,36 @@
-
<ul>
- <li>
- A multi-paragraph list,
- unindented.
- </li>
+<li>A multi-paragraph list,
+unindented.</li>
</ul>
-<p>Simple tight list
-</p>
+<p>Simple tight list</p>
<ul>
- <li>
- Uno
- </li>
-
- <li>
- Due
- </li>
-
- <li>
- Tri
- </li>
+<li>Uno</li>
+<li>Due</li>
+<li>Tri</li>
</ul>
-<p>A singleton tight list:
-</p>
+<p>A singleton tight list:</p>
<ul>
- <li>
- Uno
- </li>
+<li>Uno</li>
</ul>
-<p>A lose list:
-</p>
+<p>A lose list:</p>
<ul>
- <li><p>One
-</p>
-
- </li>
-
- <li><p>Two
-</p>
-
- </li>
-
- <li><p>Three
-</p>
-
- </li>
+<li>
+<p>One</p>
+</li>
+<li>
+<p>Two</p>
+</li>
+<li>
+<p>Three</p>
+</li>
</ul>
-<p>A lose list with paragraphs
-</p>
+<p>A lose list with paragraphs</p>
<ul>
- <li><p>One one one one
-</p>
-<p>one one one one
-</p>
-
- </li>
-
- <li><p>Two two two two
-</p>
-
- </li>
-</ul>
-
-
+<li>
+<p>One one one one</p>
+<p>one one one one</p>
+</li>
+<li>
+<p>Two two two two</p>
+</li>
+</ul> \ No newline at end of file
diff --git a/tests/misc/lists2.html b/tests/misc/lists2.html
index dcc2f81..991395b 100644
--- a/tests/misc/lists2.html
+++ b/tests/misc/lists2.html
@@ -1,10 +1,5 @@
-
<ul>
- <li>
- blah blah blah
- sdf asdf asdf asdf asdf
- asda asdf asdfasd
- </li>
-</ul>
-
-
+<li>blah blah blah
+sdf asdf asdf asdf asdf
+asda asdf asdfasd</li>
+</ul> \ No newline at end of file
diff --git a/tests/misc/lists3.html b/tests/misc/lists3.html
index dcc2f81..991395b 100644
--- a/tests/misc/lists3.html
+++ b/tests/misc/lists3.html
@@ -1,10 +1,5 @@
-
<ul>
- <li>
- blah blah blah
- sdf asdf asdf asdf asdf
- asda asdf asdfasd
- </li>
-</ul>
-
-
+<li>blah blah blah
+sdf asdf asdf asdf asdf
+asda asdf asdfasd</li>
+</ul> \ No newline at end of file
diff --git a/tests/misc/lists4.html b/tests/misc/lists4.html
index 399ca9c..4b6b32c 100644
--- a/tests/misc/lists4.html
+++ b/tests/misc/lists4.html
@@ -1,21 +1,8 @@
-
<ul>
- <li>
- item1
- </li>
-
- <li>
- item2<ol>
- <li>
- Number 1
- </li>
-
- <li>
- Number 2
- </li>
+<li>item1</li>
+<li>item2<ol>
+<li>Number 1</li>
+<li>Number 2</li>
</ol>
-
- </li>
-</ul>
-
-
+</li>
+</ul> \ No newline at end of file
diff --git a/tests/misc/lists5.html b/tests/misc/lists5.html
index 460a27d..c3dbda4 100644
--- a/tests/misc/lists5.html
+++ b/tests/misc/lists5.html
@@ -1,21 +1,14 @@
-
-<blockquote><p>This is a test of a block quote
- With just two lines
-</p>
-</blockquote><p>A paragraph
-</p>
-<blockquote><p>This is a more difficult case
- With a list item inside the quote
-</p>
+<blockquote>
+<p>This is a test of a block quote
+With just two lines</p>
+</blockquote>
+<p>A paragraph</p>
+<blockquote>
+<p>This is a more difficult case
+With a list item inside the quote</p>
<ul>
- <li>
- Alpha
- </li>
-
- <li>
- Beta
- Etc.
- </li>
+<li>Alpha</li>
+<li>Beta
+Etc.</li>
</ul>
-</blockquote>
-
+</blockquote> \ No newline at end of file
diff --git a/tests/misc/markup-inside-p.html b/tests/misc/markup-inside-p.html
index 6cd0547..c0478fb 100644
--- a/tests/misc/markup-inside-p.html
+++ b/tests/misc/markup-inside-p.html
@@ -1,25 +1,17 @@
-
-<p>
+<p><p>
_foo_
-</p>
-
-<p>
+</p></p>
+<p><p>
_foo_
-</p>
-
-<p>_foo_</p>
-
-<p>
+</p></p>
+<p><p>_foo_</p></p>
+<p><p>
_foo_
-</p>
-
-<p>
+</p></p>
+<p><p>
_foo_
-</p>
-
-
-
+</p></p> \ No newline at end of file
diff --git a/tests/misc/mismatched-tags.html b/tests/misc/mismatched-tags.html
index 0004a19..edeba33 100644
--- a/tests/misc/mismatched-tags.html
+++ b/tests/misc/mismatched-tags.html
@@ -1,9 +1,5 @@
-
-<p>Some text</p><div>some more text</div>
+<p><p>Some text</p><div>some more text</div>
and a bit more
-
-
-
-
+</p> \ No newline at end of file
diff --git a/tests/misc/more_comments.html b/tests/misc/more_comments.html
index d3107d1..d4430cd 100644
--- a/tests/misc/more_comments.html
+++ b/tests/misc/more_comments.html
@@ -1,5 +1,4 @@
-
-<!--asd@asdfd.com>
+<p><!--asd@asdfd.com>
<!asd@asdfd.com>
@@ -7,7 +6,4 @@
Test
-
-
-
-
+</p> \ No newline at end of file
diff --git a/tests/misc/multi-line-tags.html b/tests/misc/multi-line-tags.html
index d47e1e2..6d2d97f 100644
--- a/tests/misc/multi-line-tags.html
+++ b/tests/misc/multi-line-tags.html
@@ -1,9 +1,3 @@
-
-<div>
-
-<p>asdf asdfasd
-</p>
-</div>
-
-
-
+<p><div></p>
+<p>asdf asdfasd</p>
+<p></div></p> \ 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 b213d84..3602405 100644
--- a/tests/misc/multi-paragraph-block-quote.html
+++ b/tests/misc/multi-paragraph-block-quote.html
@@ -1,10 +1,8 @@
-
-<blockquote><p>This is line one of paragraph one
- This is line two of paragraph one
-</p>
-<p>This is line one of paragraph two
-</p>
-</blockquote><blockquote><p>This is another blockquote.
-</p>
+<blockquote>
+<p>This is line one of paragraph one
+This is line two of paragraph one</p>
+<p>This is line one of paragraph two</p>
</blockquote>
-
+<blockquote>
+<p>This is another blockquote.</p>
+</blockquote> \ No newline at end of file
diff --git a/tests/misc/multi-test.html b/tests/misc/multi-test.html
index 5af759b..fbb37f3 100644
--- a/tests/misc/multi-test.html
+++ b/tests/misc/multi-test.html
@@ -1,37 +1,23 @@
-
-
<h1 id="inthebeginning">Header </h1>
-<p>Now, let's try something <em class="special">inline</em>, to see if it works
-</p>
+<p>Now, let's try something <em class="special">inline</em>, to see if it works</p>
<p>Blah blah blah <a href="http://www.slashdot.org">http://www.slashdot.org</a>
</p>
<ul>
- <li>
- Basic list
- </li>
-
- <li>
- Basic list 2
- </li>
+<li>Basic list</li>
+<li>Basic list 2</li>
</ul>
-<p>addss
-</p>
+<p>addss</p>
<ul>
- <li>
- Lazy list
- </li>
+<li>Lazy list</li>
</ul>
-<p>An <a href="http://example.com" title="Title">example</a> (oops)
-</p>
+<p>An <a href="http://example.com" title="Title">example</a>(oops)</p>
<p>Now, let's use a footnote[^1]. Not bad, eh?
- Let's continue.
-</p>
-<p> [^1]: Here is the text of the footnote
- continued on several lines.
- some more of the footnote, etc.
-</p>
-<pre><code>Actually, another paragraph too.
-</code></pre><p>And then there is a little bit of text.
-</p>
-
-
+Let's continue.</p>
+<p>[^1]: Here is the text of the footnote
+ continued on several lines.
+ some more of the footnote, etc.</p>
+<pre>
+<code>Actually, another paragraph too.
+</code>
+</pre>
+<p>And then there is a little bit of text.</p>
diff --git a/tests/misc/multiline-comments.html b/tests/misc/multiline-comments.html
index 14d2a62..429e71b 100644
--- a/tests/misc/multiline-comments.html
+++ b/tests/misc/multiline-comments.html
@@ -1,21 +1,13 @@
-
-<!--
+<p><!--
foo
--->
-
-<p>
+--></p>
+<p><p>
foo
-</p>
-
-<div>
-
-<p>foo
-</p>
-</div>
-
-
-
+</p></p>
+<p><div></p>
+<p>foo</p>
+<p></div></p> \ No newline at end of file
diff --git a/tests/misc/normalize.html b/tests/misc/normalize.html
index b151cf9..a6daf8f 100644
--- a/tests/misc/normalize.html
+++ b/tests/misc/normalize.html
@@ -1,5 +1,3 @@
-
-<p><a href="http://www.stuff.com/q?x=1&amp;y=2&lt;&gt;">Link</a>
-</p>
-
-
+<p>
+<a href="http://www.stuff.com/q?x=1&amp;y=2&lt;&gt;">Link</a>
+</p> \ No newline at end of file
diff --git a/tests/misc/numeric-entity.html b/tests/misc/numeric-entity.html
index 34d4e97..2fa51aa 100644
--- a/tests/misc/numeric-entity.html
+++ b/tests/misc/numeric-entity.html
@@ -1,7 +1,4 @@
-
-<p><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#117;&#115;&#101;&#114;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;">&#117;&#115;&#101;&#114;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;</a>
+<p>
+<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#117;&#115;&#101;&#114;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;">&#117;&#115;&#101;&#114;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;</a>
</p>
-<p>This is an entity: &#234;
-</p>
-
-
+<p>This is an entity: &#234;</p> \ No newline at end of file
diff --git a/tests/misc/php.html b/tests/misc/php.html
index 183716f..db0333c 100644
--- a/tests/misc/php.html
+++ b/tests/misc/php.html
@@ -1,16 +1,9 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+<p><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<b>This should have a p tag</b>
-<!--This is a comment -->
-
-<div>This shouldn't</div>
-
-<?php echo "block_level";?>
-
-<p> &lt;?php echo "not_block_level";?&gt;
-</p>
-
-
+<!--This is a comment --></p>
+<p><div>This shouldn't</div></p>
+<p><?php echo "block_level";?></p>
+<p>&lt;?php echo "not_block_level";?&gt;</p> \ No newline at end of file
diff --git a/tests/misc/pre.html b/tests/misc/pre.html
index 01f5a29..5ac9799 100644
--- a/tests/misc/pre.html
+++ b/tests/misc/pre.html
@@ -1,17 +1,12 @@
-
-<pre>
+<p><pre>
aaa
bbb
-</pre>
-
-<pre>
+</pre></p>
+<p><pre>
* and this is pre-formatted content
* and it should be printed just like this
* and not formatted as a list
-</pre>
-
-
-
+</pre></p> \ No newline at end of file
diff --git a/tests/misc/russian.html b/tests/misc/russian.html
index 01656e3..fef2ebc 100644
--- a/tests/misc/russian.html
+++ b/tests/misc/russian.html
@@ -1,15 +1,8 @@
-
-
<h1>Недвард «Нед» Фландерс</h1>
-<p><strong>Недвард «Нед» Фландерс</strong> (Nedward «Ned» Flanders) — вымышленный персонаж мультсериала «[Симпсоны][]», озвученный Гарри Ширером. Он и его семья живут по соседству от семьи Симпсонов. Набожный христианин, Нед является одним из столпов морали Спрингфилда. В эпизоде «Alone Again, Natura-Diddily» он овдовел, его жена Мод погибла в результате несчастного случая.
-</p>
+<p>
+<strong>Недвард «Нед» Фландерс</strong>(Nedward «Ned» Flanders) — вымышленный персонаж мультсериала «[Симпсоны][]», озвученный Гарри Ширером. Он и его семья живут по соседству от семьи Симпсонов. Набожный христианин, Нед является одним из столпов морали Спрингфилда. В эпизоде «Alone Again, Natura-Diddily» он овдовел, его жена Мод погибла в результате несчастного случая.</p>
<p>Нед был одним из первых персонажей в мультсериале, который не был членом семьи Симпсонов. Начиная с первых серий, он регулярно появляется в «Симпсонах». Считается, что Нед Фландерс был назван в честь улицы <em>Northeast Flanders St.</em> в <a href="http://www.portland.gov">Портленде</a>, Орегон, родном городе создателя мультсериала Мэтта Грейнинга]]. Надпись на указателе улицы <em>NE Flanders St.</em> хулиганы часто исправляли на <em>NED Flanders St.</em>
</p>
-
<h2>Биография</h2>
-<p>Нед Фландерс родился в Нью-Йорке, его родители были битниками. Его отец в точности похож на взрослого Неда, только он носил козлиную бородку. Их отказ от воспитания Неда и то, что они, в общем-то, были плохими родителями («мы ничего в этом не понимаем и не знаем как начать») привело к тому, что Нед превратился в ужасного сорванца. В конце концов они согласились на экспериментальную восьмимесячную шлепологическую терапию Миннесотского Университета (воспоминания Неда в эпизоде «Hurricane Neddy»), которая научила его подавлять чувство злости. Побочным эфектом терапии стало то, что Нед стал ненавидеть своих родителей (это одна из двух вещей которые ненавидит Фландерс, вторая — отделения почты, чьи длинные очереди, суета и угрюмый персонал раздражают его).
-</p>
-<p>У Неда есть странная привычка добавлять «дидли», «дадли» и другие бессмысленные слова в свои фразы при разговоре, например: «Hi-diddly-ho, neighbor-ino» («Приветик, соседушка»). Это результат сублимации его злости, вызванной сдерживанием гнева, который не имеет никакого другого выхода.
-</p>
-
-
+<p>Нед Фландерс родился в Нью-Йорке, его родители были битниками. Его отец в точности похож на взрослого Неда, только он носил козлиную бородку. Их отказ от воспитания Неда и то, что они, в общем-то, были плохими родителями («мы ничего в этом не понимаем и не знаем как начать») привело к тому, что Нед превратился в ужасного сорванца. В конце концов они согласились на экспериментальную восьмимесячную шлепологическую терапию Миннесотского Университета (воспоминания Неда в эпизоде «Hurricane Neddy»), которая научила его подавлять чувство злости. Побочным эфектом терапии стало то, что Нед стал ненавидеть своих родителей (это одна из двух вещей которые ненавидит Фландерс, вторая — отделения почты, чьи длинные очереди, суета и угрюмый персонал раздражают его).</p>
+<p>У Неда есть странная привычка добавлять «дидли», «дадли» и другие бессмысленные слова в свои фразы при разговоре, например: «Hi-diddly-ho, neighbor-ino» («Приветик, соседушка»). Это результат сублимации его злости, вызванной сдерживанием гнева, который не имеет никакого другого выхода.</p>
diff --git a/tests/misc/some-test.html b/tests/misc/some-test.html
index 646482e..54a3e23 100644
--- a/tests/misc/some-test.html
+++ b/tests/misc/some-test.html
@@ -1,104 +1,72 @@
<hr />
-
<ul>
- <li><p>as if
-</p>
-
- </li>
-
- <li><p>as if2
-</p>
-
- </li>
+<li>
+<p>as if</p>
+</li>
+<li>
+<p>as if2</p>
+</li>
</ul>
<hr />
-
<ul>
- <li><p>as if
-</p>
-
- </li>
-
- <li><p>as if2
-</p>
-
- </li>
+<li>
+<p>as if</p>
+</li>
+<li>
+<p>as if2</p>
+</li>
</ul>
<hr />
-
<ul>
- <li>
- as if
- non_code
- </li>
-
- <li>
- as if2
- </li>
+<li>as if
+non_code</li>
+<li>as if2</li>
</ul>
-<p>Markdown
-</p>
+<p>Markdown</p>
<ul>
- <li><p>Python
- is ok
-</p>
+<li>
+<p>Python
+is ok</p>
<ul>
- <li>
- Therefore i am
- </li>
+<li>Therefore i am</li>
</ul>
-
- </li>
-
- <li><p>Perl sucks
- big time
-</p>
+</li>
+<li>
+<p>Perl sucks
+big time</p>
<ul>
- <li>
- But that's
- ok
- </li>
+<li>But that's
+ok</li>
</ul>
-
- </li>
-
- <li><p>Python is
- ok
- Or not?
-</p>
-
- </li>
+</li>
+<li>
+<p>Python is
+ok
+Or not?</p>
+</li>
</ul>
-<p>Here is a normal paragraph
-</p>
+<p>Here is a normal paragraph</p>
<ol>
- <li><p>Another list
- with a bunch of items
-</p>
-
- </li>
-
- <li><p>Mostly fruits
-</p>
+<li>
+<p>Another list
+with a bunch of items</p>
+</li>
+<li>
+<p>Mostly fruits</p>
<ol>
- <li>
- Apple
- </li>
-
- <li>
- Pare
- </li>
+<li>Apple</li>
+<li>Pare</li>
</ol>
-
- </li>
+</li>
</ol>
-<p>asdfasdfasd
-</p>
-<pre><code># This is a code example
+<p>asdfasdfasd</p>
+<pre>
+<code># This is a code example
import stuff
Another code example
* Lists and similar stuff
&gt; Should be ignored
-</code></pre> \ No newline at end of file
+</code>
+</pre>
diff --git a/tests/misc/span.html b/tests/misc/span.html
index 354f926..dadf5df 100644
--- a/tests/misc/span.html
+++ b/tests/misc/span.html
@@ -1,11 +1,4 @@
-
-<p><span id="someId"> Foo <em>bar</em> Baz </span>
-</p>
-<div><b>*foo*</b></div>
-
-<div id="someId"> Foo *bar* Baz </div>
-
-<p><baza id="someId"> Foo <em>bar</em> Baz </baza>
-</p>
-
-
+<p><span id="someId"> Foo <em>bar</em> Baz </span></p>
+<p><div><b>*foo*</b></div></p>
+<p><div id="someId"> Foo *bar* Baz </div></p>
+<p><baza id="someId"> Foo <em>bar</em> Baz </baza></p>
diff --git a/tests/misc/strong-with-underscores.html b/tests/misc/strong-with-underscores.html
index 0074174..cab3863 100644
--- a/tests/misc/strong-with-underscores.html
+++ b/tests/misc/strong-with-underscores.html
@@ -1,2 +1,3 @@
-<p><strong>this_is_strong</strong>
-</p>
+<p>
+<strong>this_is_strong</strong>
+</p> \ No newline at end of file
diff --git a/tests/misc/stronintags.html b/tests/misc/stronintags.html
index d17fa18..48e4364 100644
--- a/tests/misc/stronintags.html
+++ b/tests/misc/stronintags.html
@@ -1,10 +1,10 @@
-
-<p>this is a <a href="http://example.com/"><strong>test</strong></a>
+<p>this is a <a href="http://example.com/">
+<strong>test</strong>
+</a>
</p>
-<p>this is a second <strong><a href="http://example.com">test</a></strong>
+<p>this is a second <strong>
+<a href="http://example.com">test</a>
+</strong>
</p>
<p>reference <strong>[test][]</strong>
- reference [<strong>test</strong>][]
-</p>
-
-
+reference [<strong>test</strong>][]</p> \ No newline at end of file
diff --git a/tests/misc/tabs-in-lists.html b/tests/misc/tabs-in-lists.html
index 7f61928..a1a92ec 100644
--- a/tests/misc/tabs-in-lists.html
+++ b/tests/misc/tabs-in-lists.html
@@ -1,67 +1,42 @@
-
-<p>First a list with a tabbed line
-</p>
+<p>First a list with a tabbed line</p>
<ul>
- <li><p>A
-</p>
-
- </li>
-
- <li><p>B
-</p>
-
- </li>
+<li>
+<p>A</p>
+</li>
+<li>
+<p>B</p>
+</li>
</ul>
-<p>Just a blank line:
-</p>
+<p>Just a blank line:</p>
<ul>
- <li><p>A
-</p>
-
- </li>
-
- <li><p>B
-</p>
-
- </li>
+<li>
+<p>A</p>
+</li>
+<li>
+<p>B</p>
+</li>
</ul>
-<p>Now a list with 4 spaces and some text:
-</p>
+<p>Now a list with 4 spaces and some text:</p>
<ul>
- <li>
- A
- abcdef
- </li>
-
- <li>
- B
- </li>
+<li>A
+abcdef</li>
+<li>B</li>
</ul>
-<p>Now with a tab and an extra space:
-</p>
+<p>Now with a tab and an extra space:</p>
<ul>
- <li><p>A
-</p>
-
- </li>
-
- <li><p>B
-</p>
-
- </li>
+<li>
+<p>A</p>
+</li>
+<li>
+<p>B</p>
+</li>
</ul>
-<p>Now a list with 4 spaces:
-</p>
+<p>Now a list with 4 spaces:</p>
<ul>
- <li><p>A
-</p>
-
- </li>
-
- <li><p>B
-</p>
-
- </li>
-</ul>
-
-
+<li>
+<p>A</p>
+</li>
+<li>
+<p>B</p>
+</li>
+</ul> \ No newline at end of file
diff --git a/tests/misc/two-spaces.html b/tests/misc/two-spaces.html
index 9d07be4..fe765de 100644
--- a/tests/misc/two-spaces.html
+++ b/tests/misc/two-spaces.html
@@ -1,31 +1,20 @@
-<p>This line has two spaces at the end<br />
-but this one has none
- but this line has three <br />
-and this is the second from last line
- in this test message
-</p>
+<p>This line has two spaces at the end<br />but this one has none
+but this line has three <br />and this is the second from last line
+in this test message</p>
<ul>
- <li><p>This list item has two spaces.<br />
-
-</p>
-
- </li>
-
- <li><p>This has none.
- This line has three. <br />
-This line has none.
- And this line two.<br />
-
-</p>
-<p>This line has none.
+<li>
+<p>This list item has two spaces.<br />
</p>
-
- </li>
-
- <li><p>This line has none.
+</li>
+<li>
+<p>This has none.
+This line has three. <br />This line has none.
+And this line two.<br />
</p>
-
- </li>
+<p>This line has none.</p>
+</li>
+<li>
+<p>This line has none.</p>
+</li>
</ul>
-<p>And this is the end.
-</p> \ No newline at end of file
+<p>And this is the end.</p> \ No newline at end of file
diff --git a/tests/misc/uche.html b/tests/misc/uche.html
index f438f3d..ddd569d 100644
--- a/tests/misc/uche.html
+++ b/tests/misc/uche.html
@@ -1,7 +1,14 @@
-<p><img src="http://fourthought.com/images/ftlogo.png" title="Fourthought logo" alt="asif"/>
+<p>
+<img alt="asif" src="http://fourthought.com/images/ftlogo.png" title="Fourthought logo" />
</p>
-<p><a href="http://fourthought.com/"><img src="http://fourthought.com/images/ftlogo.png" title="Fourthought logo" style="float: left; margin: 10px; border:
-none;" alt=""/></a>
+<p>
+<a href="http://fourthought.com/">
+<img alt="" src="http://fourthought.com/images/ftlogo.png" style="float: left; margin: 10px; border:
+none;" title="Fourthought logo" />
+</a>
+</p>
+<p>
+<a href="http://link.com/">
+<img alt="text" src="x" />
+</a>
</p>
-<p><a href="http://link.com/"><img src="x" alt="text"/></a>
-</p> \ No newline at end of file
diff --git a/tests/misc/underscores.html b/tests/misc/underscores.html
index 14ccb02..43b488f 100644
--- a/tests/misc/underscores.html
+++ b/tests/misc/underscores.html
@@ -1,15 +1,8 @@
-
-<p>THIS_SHOULD_STAY_AS_IS
-</p>
-<p>Here is some <em>emphasis</em>, ok?
-</p>
-<p>Ok, at least <em>this</em> should work.
-</p>
-<p>THIS<strong>SHOULD</strong>STAY
-</p>
-<p>Here is some <strong>strong</strong> stuff.
-</p>
-<p>THIS<strong><em>SHOULD</em></strong>STAY?
-</p>
-
-
+<p>THIS_SHOULD_STAY_AS_IS</p>
+<p>Here is some <em>emphasis</em>, ok?</p>
+<p>Ok, at least <em>this</em>should work.</p>
+<p>THIS<strong>SHOULD</strong>STAY</p>
+<p>Here is some <strong>strong</strong>stuff.</p>
+<p>THIS<strong>
+<em>SHOULD</em>
+</strong>STAY?</p> \ No newline at end of file
diff --git a/tests/misc/url_spaces.html b/tests/misc/url_spaces.html
index 78c6521..f81f55e 100644
--- a/tests/misc/url_spaces.html
+++ b/tests/misc/url_spaces.html
@@ -1,7 +1,6 @@
-
-<p><a href="http://wikipedia.org/wiki/Dawn of War">Dawn of War</a>
+<p>
+<a href="http://wikipedia.org/wiki/Dawn of War">Dawn of War</a>
</p>
-<p><a href="http://wikipedia.org/wiki/Dawn of War" title="Dawn of War">Dawn of War</a>
-</p>
-
-
+<p>
+<a href="http://wikipedia.org/wiki/Dawn of War" title="Dawn of War">Dawn of War</a>
+</p> \ No newline at end of file
diff --git a/tests/safe_mode/inline-html-advanced.html b/tests/safe_mode/inline-html-advanced.html
index bc59ab1..e9dd2ec 100644
--- a/tests/safe_mode/inline-html-advanced.html
+++ b/tests/safe_mode/inline-html-advanced.html
@@ -1,14 +1,11 @@
-<p>Simple block on one line:
-</p>
-&lt;div&gt;foo&lt;/div&gt;
-
-<p>And nested without indentation:
-</p>
-&lt;div&gt;
+<p>Simple block on one line:</p>
+<p>&lt;div&gt;foo&lt;/div&gt;</p>
+<p>And nested without indentation:</p>
+<p>&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
foo
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;bar&lt;/div&gt;
-&lt;/div&gt; \ No newline at end of file
+&lt;/div&gt;</p> \ No newline at end of file
diff --git a/tests/safe_mode/inline-html-comments.html b/tests/safe_mode/inline-html-comments.html
index 8deccba..0f1e417 100644
--- a/tests/safe_mode/inline-html-comments.html
+++ b/tests/safe_mode/inline-html-comments.html
@@ -1,14 +1,8 @@
-<p>Paragraph one.
-</p>
-&lt;!-- This is a simple comment --&gt;
-
-&lt;!--
+<p>Paragraph one.</p>
+<p>&lt;!-- This is a simple comment --&gt;</p>
+<p>&lt;!--
This is another comment.
---&gt;
-
-<p>Paragraph two.
-</p>
-&lt;!-- one comment block -- -- with two comments --&gt;
-
-<p>The end.
-</p> \ No newline at end of file
+--&gt;</p>
+<p>Paragraph two.</p>
+<p>&lt;!-- one comment block -- -- with two comments --&gt;</p>
+<p>The end.</p> \ No newline at end of file
diff --git a/tests/safe_mode/inline-html-simple.html b/tests/safe_mode/inline-html-simple.html
index 24d16ba..ceaaa90 100644
--- a/tests/safe_mode/inline-html-simple.html
+++ b/tests/safe_mode/inline-html-simple.html
@@ -1,64 +1,53 @@
-<p>Here's a simple block:
-</p>
-&lt;div&gt;
+<p>Here's a simple block:</p>
+<p>&lt;div&gt;
foo
-&lt;/div&gt;
-
-<p>This should be a code block, though:
-</p>
-<pre><code>&lt;div&gt;
+&lt;/div&gt;</p>
+<p>This should be a code block, though:</p>
+<pre>
+<code>&lt;div&gt;
foo
&lt;/div&gt;
-</code></pre><p>As should this:
-</p>
-<pre><code>&lt;div&gt;foo&lt;/div&gt;
-</code></pre><p>Now, nested:
-</p>
-&lt;div&gt;
+</code>
+</pre>
+<p>As should this:</p>
+<pre>
+<code>&lt;div&gt;foo&lt;/div&gt;
+</code>
+</pre>
+<p>Now, nested:</p>
+<p>&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
foo
&lt;/div&gt;
&lt;/div&gt;
-&lt;/div&gt;
-
-<p>This should just be an HTML comment:
-</p>
-&lt;!-- Comment --&gt;
-
-<p>Multiline:
-</p>
-&lt;!--
+&lt;/div&gt;</p>
+<p>This should just be an HTML comment:</p>
+<p>&lt;!-- Comment --&gt;</p>
+<p>Multiline:</p>
+<p>&lt;!--
Blah
Blah
---&gt;
-
-<p>Code block:
-</p>
-<pre><code>&lt;!-- Comment --&gt;
-</code></pre><p>Just plain comment, with trailing spaces on the line:
-</p>
-&lt;!-- foo --&gt;
-
-<p>Code:
-</p>
-<pre><code>&lt;hr /&gt;
-</code></pre><p>Hr's:
-</p>
-&lt;hr&gt;
-
-&lt;hr/&gt;
-
-&lt;hr /&gt;
-
-&lt;hr&gt;
-
-&lt;hr/&gt;
-
-&lt;hr /&gt;
-
-&lt;hr class=&quot;foo&quot; id=&quot;bar&quot; /&gt;
-
-&lt;hr class=&quot;foo&quot; id=&quot;bar&quot;/&gt;
-
-&lt;hr class=&quot;foo&quot; id=&quot;bar&quot; &gt; \ No newline at end of file
+--&gt;</p>
+<p>Code block:</p>
+<pre>
+<code>&lt;!-- Comment --&gt;
+</code>
+</pre>
+<p>Just plain comment, with trailing spaces on the line:</p>
+<p>&lt;!-- foo --&gt;</p>
+<p>Code:</p>
+<pre>
+<code>&lt;hr /&gt;
+</code>
+</pre>
+<p>Hr's:</p>
+<p>&lt;hr&gt;</p>
+<p>&lt;hr/&gt;</p>
+<p>&lt;hr /&gt;</p>
+<p>&lt;hr&gt;</p>
+<p>&lt;hr/&gt;</p>
+<p>&lt;hr /&gt;</p>
+<p>&lt;hr class=&quot;foo&quot; id=&quot;bar&quot; /&gt;</p>
+<p>&lt;hr class=&quot;foo&quot; id=&quot;bar&quot;/&gt;</p>
+<p>&lt;hr class=&quot;foo&quot; id=&quot;bar&quot; &gt;</p> \ No newline at end of file
diff --git a/tests/safe_mode/script_tags.html b/tests/safe_mode/script_tags.html
index cb2abfa..4c669dd 100644
--- a/tests/safe_mode/script_tags.html
+++ b/tests/safe_mode/script_tags.html
@@ -1,26 +1,20 @@
-<p>This should be stripped/escaped in safe_mode.
-</p>
-&lt;script&gt;
+<p>This should be stripped/escaped in safe_mode.</p>
+<p>&lt;script&gt;
alert(&quot;Hello world!&quot;)
-&lt;/script&gt;
-
-<p>With blank lines.
-</p>
-&lt;script&gt;
+&lt;/script&gt;</p>
+<p>With blank lines.</p>
+<p>&lt;script&gt;
alert(&quot;Hello world!&quot;)
-&lt;/script&gt;
-
-<p>Now with some weirdness
-</p>
-<p><code>&lt;script &lt;!--
+&lt;/script&gt;</p>
+<p>Now with some weirdness</p>
+<p>
+<code>&lt;script &lt;!--
alert("Hello world!")
-&lt;/script &lt;&gt;</code>`
-</p>
-<p>Try another way.
-</p>
-&lt;script &lt;!--
+&lt;/script &lt;&gt;</code>`</p>
+<p>Try another way.</p>
+<p>&lt;script &lt;!--
alert(&quot;Hello world!&quot;)
&lt;/script &lt;&gt;
@@ -30,4 +24,6 @@ This time with blank lines.
alert(&quot;Hello world!&quot;)
-&lt;/script &lt;&gt; \ No newline at end of file
+&lt;/script &lt;&gt;
+
+</p> \ No newline at end of file
diff --git a/tests/safe_mode/unsafe_urls.html b/tests/safe_mode/unsafe_urls.html
index fe37840..6dabe64 100644
--- a/tests/safe_mode/unsafe_urls.html
+++ b/tests/safe_mode/unsafe_urls.html
@@ -1,25 +1,26 @@
-<p>These links should be unsafe and not allowed in safe_mode
+<p>These links should be unsafe and not allowed in safe_mode</p>
+<p>
+<a href="">link</a>
+<a href="">link</a>
+<a href="">link</a>
+<a href="">link</a>
+<a href="">link</a>
+<a href="">link</a>
+<a href="">link</a>
+<a href="">link</a>
+<a href="">link</a>
+<a href="">link</a>
+<a href="">link</a>
</p>
-<p><a href="">link</a>
- <a href="">link</a>
- <a href="">link</a>
- <a href="">link</a>
- <a href="">link</a>
- <a href="">link</a>
- <a href="">link</a>
- <a href="">link</a>
- <a href="">link</a>
- <a href="">link</a>
- <a href="">link</a>
+<p>
+<img alt="img" src="" />
+<a href="">ref</a>
+<img alt="imgref" src="" />
</p>
-<p><img src="" alt="img"/>
- <a href="">ref</a>
- <img src="" alt="imgref"/>
-</p>
-<p>These should work regardless:
-</p>
-<p><a href="relative/url.html">relative</a>
- <a href="mailto:foo@bar.com">email</a>
- <a href="news:some.news.group.com">news scheme</a>
- <a href="http://example.com">http link</a>
+<p>These should work regardless:</p>
+<p>
+<a href="relative/url.html">relative</a>
+<a href="mailto:foo@bar.com">email</a>
+<a href="news:some.news.group.com">news scheme</a>
+<a href="http://example.com">http link</a>
</p>