Git Product home page Git Product logo

markd's Introduction

markd

Language Tag Build Status

THIS PROJECT IS LOOKING FOR MAINTAINER

Unfortunately, the maintainer no longer has the time and/or resources to work on markd further. This means that bugs will not be fixed and features will not be added unless someone else does so.

If you're interested in fixing up markd, please file an issue let me know.


Yet another markdown parser built for speed, written in Crystal, Compliant to CommonMark specification (v0.29). Copy from commonmark.js.

Installation

Add this to your application's shard.yml:

dependencies:
  markd:
    github: icyleaf/markd

Quick start

require "markd"

markdown = <<-MD
# Hello Markd

> Yet another markdown parser built for speed, written in Crystal, Compliant to CommonMark specification.
MD

html = Markd.to_html(markdown)

Also here are options to configure the parse and render.

options = Markd::Options.new(smart: true, safe: true)
Markd.to_html(markdown, options)

Options

Name Type Default value Description
time Bool false render parse cost time during read source, parse blocks, parse inline.
smart Bool false if true, straight quotes will be made curly,
-- will be changed to an en dash,
--- will be changed to an em dash, and
... will be changed to ellipses.
source_pos Bool false if true, source position information for block-level elements
will be rendered in the data-sourcepos attribute (for HTML)
safe Bool false if true, raw HTML will not be passed through to HTML output (it will be replaced by comments)
prettyprint Bool false if true, code tags generated by code blocks will have a prettyprint class added to them, to be used by Google code-prettify.
gfm Bool false Not supported for now
toc Bool false Not supported for now
base_url URI? nil if not nil, relative URLs of links are resolved against this URI. It act's like HTML's <base href="base_url"> in the context of a Markdown document.

Advanced

If you want to use a custom renderer, it can!

class CustomRenderer < Markd::Renderer

  def strong(node, entering)
  end

  # more methods following in render.
end

options = Markd::Options.new(time: true)
document = Markd::Parser.parse(markdown, options)
renderer = CustomRenderer.new(options)

html = renderer.render(document)

Performance

Here is the result of a sample markdown file parse at MacBook Pro Retina 2015 (2.2 GHz):

Crystal Markdown (no longer present)   3.28k (305.29µs) (± 0.92%)       fastest
           Markd                       305.36 (  3.27ms) (± 5.52%) 10.73× slower

Recently, I'm working to compare the other popular commonmark parser, the code is stored in benchmarks.

How to Contribute

Your contributions are always welcome! Please submit a pull request or create an issue to add a new question, bug or feature to the list.

All Contributors are on the wall.

You may also like

  • halite - HTTP Requests Client with a chainable REST API, built-in sessions and middlewares.
  • totem - Load and parse a configuration file or string in JSON, YAML, dotenv formats.
  • poncho - A .env parser/loader improved for performance.
  • popcorn - Easy and Safe casting from one type to another.
  • fast-crystal - 💨 Writing Fast Crystal 😍 -- Collect Common Crystal idioms.

License

MIT License © icyleaf

markd's People

Contributors

asdffdsdaf avatar asterite avatar bcardiff avatar bdtomlin avatar calamari avatar devnote-dev avatar dscottboggs avatar hertzdevil avatar icyleaf avatar jsoref avatar kianmeng avatar nephos avatar nobodywasishere avatar oz avatar straight-shoota avatar taylorthurlow avatar woodruffw avatar wooster0 avatar xfbs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

markd's Issues

May I maintain this repository?

Hello, I'm just a freshman crystal programmer. On seeing your banner searching for maintainers, I would like to recommend myself for the position. Though I'm not much skilled, I have spare time, interest for this repository. Also I'm working on translating crystal language references into Chinese Version

In fact, I'm depending on this lib for my pirate gitbook project gitbook.cr, so I forked this repo, trying to add traverse and inspect functionality for nodes.

Update codebase to current Crystal

A lot of the codebase seems to be using code that was likely before the Crystal 1.0 release, and while parts of the library have been updated in recent-ish updates, a lot of it still uses old or outdated code/practices. My proposals are:

  • #58
  • Replace the HTML extensions/mappings with the standard library's HTML module
  • #54
  • #55
  • #56
  • Revisit specs coverage

There are few other things that I would like to propose but I will move them into separate issues. Let me know what you think.

Support Front Matter?

Hello, thank you for a very easy to use library!
I'd like to ask, do you plan to support https://jekyllrb.com/docs/front-matter/ ?
This is a format supported by Grav, a flat file CMS, or Github. (But it's not a standard form, I guess ...)
I looked at the source code to try to make it work, but my programming skills didn't allow me to figure it out.
If you can deal with it, I would appreciate it.
Thank you.

Improve documentation

I think it's safe to say that the majority of the library is undocumented or is lacking sufficient documentation. This isn't really useful if you're trying to implement a custom renderer which has many methods, or even make use of the parsers. Adding doc comments to the necessary classes/methods/etc would resolve this (maybe with examples too?), then possibly having the docs hosted? Of course, this isn't required, but it's definitely a plausible solution.

It fails 323 of 624 CommonMark tests.

Using a markdown to HTML generator binary like so:

require "markd"

markdown = [] of String

if ARGV[0]?
  File.open(ARGV[0]).each_line do |l|
    markdown << l
  end
else
  STDIN.each_line do |l|
    markdown << l
  end
end

markdown = markdown.join

options = Markd::Options.new()
document = Markd::Parser.parse(markdown, options)
renderer = Markd::HTMLRenderer.new(options)
rendered = renderer.render(document)

puts rendered

And running the CommonMark test suite using that, like so:

git clone https://github.com/commonmark/CommonMark
cd CommonMark
python3 test/spec_tests.py --program /path/to/markd_to_html

Generates the following failures also as gist:

Show output (4676 lines)

Example 3 (lines 364-371) Tabs

    a	a
    ὐ	a
--- expected HTML
+++ actual HTML
@@ -1,3 +1,2 @@
-<pre><code>a	a
-ὐ	a
+<pre><code>a	a    ὐ	a
 </code></pre>

Example 4 (lines 377-388) Tabs

  - foo

	bar
--- expected HTML
+++ actual HTML
@@ -1,6 +1,3 @@
 <ul>
-<li>
-<p>foo</p>
-<p>bar</p>
-</li>
+<li>foo	bar</li>
 </ul>

Example 5 (lines 390-402) Tabs

- foo

		bar
--- expected HTML
+++ actual HTML
@@ -1,7 +1,3 @@
 <ul>
-<li>
-<p>foo</p>
-<pre><code>  bar
-</code></pre>
-</li>
+<li>foo		bar</li>
 </ul>

Example 8 (lines 434-441) Tabs

    foo
	bar
--- expected HTML
+++ actual HTML
@@ -1,3 +1,2 @@
-<pre><code>foo
-bar
+<pre><code>foo	bar
 </code></pre>

Example 9 (lines 443-459) Tabs

 - foo
   - bar
	 - baz
--- expected HTML
+++ actual HTML
@@ -1,11 +1,3 @@
 <ul>
-<li>foo
-<ul>
-<li>bar
-<ul>
-<li>baz</li>
+<li>foo   - bar	 - baz</li>
 </ul>
-</li>
-</ul>
-</li>
-</ul>

Example 12 (lines 494-502) Precedence

- `one
- two`
--- expected HTML
+++ actual HTML
@@ -1,4 +1,3 @@
 <ul>
-<li>`one</li>
-<li>two`</li>
+<li><code>one- two</code></li>
 </ul>

Example 13 (lines 533-541) Thematic breaks

***
---
___
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<hr />
-<hr />
-<hr />
+<p>***---___</p>

Example 16 (lines 562-570) Thematic breaks

--
**
__
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<p>--
-**
-__</p>
+<p>--**__</p>

Example 17 (lines 575-583) Thematic breaks

 ***
  ***
   ***
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
 <hr />
-<hr />
-<hr />

Example 25 (lines 648-658) Thematic breaks

_ _ _ _ a

a------

---a---
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<p>_ _ _ _ a</p>
-<p>a------</p>
-<p>---a---</p>
+<p>_ _ _ _ aa---------a---</p>

Example 27 (lines 673-685) Thematic breaks

- foo
***
- bar
--- expected HTML
+++ actual HTML
@@ -1,7 +1,3 @@
 <ul>
-<li>foo</li>
+<li>foo***- bar</li>
 </ul>
-<hr />
-<ul>
-<li>bar</li>
-</ul>

Example 28 (lines 690-698) Thematic breaks

Foo
***
bar
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<p>Foo</p>
-<hr />
-<p>bar</p>
+<p>Foo***bar</p>

Example 29 (lines 707-714) Thematic breaks

Foo
---
bar
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<h2>Foo</h2>
-<p>bar</p>
+<p>Foo---bar</p>

Example 30 (lines 720-732) Thematic breaks

* Foo
* * *
* Bar
--- expected HTML
+++ actual HTML
@@ -1,7 +1,3 @@
 <ul>
-<li>Foo</li>
+<li>Foo* * ** Bar</li>
 </ul>
-<hr />
-<ul>
-<li>Bar</li>
-</ul>

Example 31 (lines 737-747) Thematic breaks

- Foo
- * * *
--- expected HTML
+++ actual HTML
@@ -1,6 +1,3 @@
 <ul>
-<li>Foo</li>
-<li>
-<hr />
-</li>
+<li>Foo- * * *</li>
 </ul>

Example 32 (lines 766-780) ATX headings

# foo
## foo
### foo
#### foo
##### foo
###### foo
--- expected HTML
+++ actual HTML
@@ -1,6 +1 @@
-<h1>foo</h1>
-<h2>foo</h2>
-<h3>foo</h3>
-<h4>foo</h4>
-<h5>foo</h5>
-<h6>foo</h6>
+<h1>foo## foo### foo#### foo##### foo###### foo</h1>

Example 34 (lines 800-807) ATX headings

#5 bolt

#hashtag
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>#5 bolt</p>
-<p>#hashtag</p>
+<p>#5 bolt#hashtag</p>

Example 38 (lines 839-847) ATX headings

 ### foo
  ## foo
   # foo
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<h3>foo</h3>
-<h2>foo</h2>
-<h1>foo</h1>
+<h3>foo  ## foo   # foo</h3>

Example 41 (lines 871-877) ATX headings

## foo ##
  ###   bar    ###
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<h2>foo</h2>
-<h3>bar</h3>
+<h2>foo ##  ###   bar</h2>

Example 42 (lines 882-888) ATX headings

# foo ##################################
##### foo ##
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<h1>foo</h1>
-<h5>foo</h5>
+<h1>foo ####################################### foo</h1>

Example 46 (lines 923-931) ATX headings

### foo \###
## foo #\##
# foo \#
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<h3>foo ###</h3>
-<h2>foo ###</h2>
-<h1>foo #</h1>
+<h3>foo ##### foo #### foo #</h3>

Example 47 (lines 937-945) ATX headings

****
## foo
****
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<hr />
-<h2>foo</h2>
-<hr />
+<p><strong><strong>## foo</strong></strong></p>

Example 48 (lines 948-956) ATX headings

Foo bar
# baz
Bar foo
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<p>Foo bar</p>
-<h1>baz</h1>
-<p>Bar foo</p>
+<p>Foo bar# bazBar foo</p>

Example 49 (lines 961-969) ATX headings

## 
#
### ###
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<h2></h2>
-<h1></h1>
-<h3></h3>
+<h2>####</h2>

Example 50 (lines 1004-1013) Setext headings

Foo *bar*
=========

Foo *bar*
---------
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<h1>Foo <em>bar</em></h1>
-<h2>Foo <em>bar</em></h2>
+<p>Foo <em>bar</em>=========Foo <em>bar</em>---------</p>

Example 51 (lines 1018-1025) Setext headings

Foo *bar
baz*
====
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<h1>Foo <em>bar
-baz</em></h1>
+<p>Foo <em>barbaz</em>====</p>

Example 52 (lines 1030-1039) Setext headings

Foo
-------------------------

Foo
=
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<h2>Foo</h2>
-<h1>Foo</h1>
+<p>Foo-------------------------Foo=</p>

Example 53 (lines 1045-1058) Setext headings

   Foo
---

  Foo
-----

  Foo
  ===
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<h2>Foo</h2>
-<h2>Foo</h2>
-<h1>Foo</h1>
+<p>Foo---  Foo-----  Foo  ===</p>

Example 54 (lines 1063-1076) Setext headings

    Foo
    ---

    Foo
---
--- expected HTML
+++ actual HTML
@@ -1,6 +1,2 @@
-<pre><code>Foo
----
-
-Foo
+<pre><code>Foo    ---    Foo---
 </code></pre>
-<hr />

Example 55 (lines 1082-1087) Setext headings

Foo
   ----      
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<h2>Foo</h2>
+<p>Foo   ----</p>

Example 57 (lines 1103-1114) Setext headings

Foo
= =

Foo
--- -
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<p>Foo
-= =</p>
-<p>Foo</p>
-<hr />
+<p>Foo= =Foo--- -</p>

Example 58 (lines 1119-1124) Setext headings

Foo  
-----
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<h2>Foo</h2>
+<p>Foo  -----</p>

Example 59 (lines 1129-1134) Setext headings

Foo\
----
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<h2>Foo\</h2>
+<p>Foo----</p>

Example 60 (lines 1140-1153) Setext headings

`Foo
----
`

<a title="a lot
---
of dashes"/>
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<h2>`Foo</h2>
-<p>`</p>
-<h2>&lt;a title=&quot;a lot</h2>
-<p>of dashes&quot;/&gt;</p>
+<p><code>Foo----</code><a title="a lot---of dashes"/></p>

Example 61 (lines 1159-1167) Setext headings

> Foo
---
--- expected HTML
+++ actual HTML
@@ -1,4 +1,3 @@
 <blockquote>
-<p>Foo</p>
+<p>Foo---</p>
 </blockquote>
-<hr />

Example 62 (lines 1170-1180) Setext headings

> foo
bar
===
--- expected HTML
+++ actual HTML
@@ -1,5 +1,3 @@
 <blockquote>
-<p>foo
-bar
-===</p>
+<p>foobar===</p>
 </blockquote>

Example 63 (lines 1183-1191) Setext headings

- Foo
---
--- expected HTML
+++ actual HTML
@@ -1,4 +1,3 @@
 <ul>
-<li>Foo</li>
+<li>Foo---</li>
 </ul>
-<hr />

Example 64 (lines 1198-1205) Setext headings

Foo
Bar
---
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<h2>Foo
-Bar</h2>
+<p>FooBar---</p>

Example 65 (lines 1211-1223) Setext headings

---
Foo
---
Bar
---
Baz
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<hr />
-<h2>Foo</h2>
-<h2>Bar</h2>
-<p>Baz</p>
+<p>---Foo---Bar---Baz</p>

Example 67 (lines 1240-1246) Setext headings

---
---
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
 <hr />
-<hr />

Example 68 (lines 1249-1257) Setext headings

- foo
-----
--- expected HTML
+++ actual HTML
@@ -1,4 +1,3 @@
 <ul>
-<li>foo</li>
+<li>foo-----</li>
 </ul>
-<hr />

Example 69 (lines 1260-1267) Setext headings

    foo
---
--- expected HTML
+++ actual HTML
@@ -1,3 +1,2 @@
-<pre><code>foo
+<pre><code>foo---
 </code></pre>
-<hr />

Example 70 (lines 1270-1278) Setext headings

> foo
-----
--- expected HTML
+++ actual HTML
@@ -1,4 +1,3 @@
 <blockquote>
-<p>foo</p>
+<p>foo-----</p>
 </blockquote>
-<hr />

Example 71 (lines 1284-1289) Setext headings

\> foo
------
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<h2>&gt; foo</h2>
+<p>&gt; foo------</p>

Example 72 (lines 1315-1325) Setext headings

Foo

bar
---
baz
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<p>Foo</p>
-<h2>bar</h2>
-<p>baz</p>
+<p>Foobar---baz</p>

Example 73 (lines 1331-1343) Setext headings

Foo
bar

---

baz
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<p>Foo
-bar</p>
-<hr />
-<p>baz</p>
+<p>Foobar---baz</p>

Example 74 (lines 1349-1359) Setext headings

Foo
bar
* * *
baz
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<p>Foo
-bar</p>
-<hr />
-<p>baz</p>
+<p>Foobar* * *baz</p>

Example 75 (lines 1364-1374) Setext headings

Foo
bar
\---
baz
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<p>Foo
-bar
----
-baz</p>
+<p>Foobar---baz</p>

Example 76 (lines 1392-1399) Indented code blocks

    a simple
      indented code block
--- expected HTML
+++ actual HTML
@@ -1,3 +1,2 @@
-<pre><code>a simple
-  indented code block
+<pre><code>a simple      indented code block
 </code></pre>

Example 77 (lines 1406-1417) Indented code blocks

  - foo

    bar
--- expected HTML
+++ actual HTML
@@ -1,6 +1,3 @@
 <ul>
-<li>
-<p>foo</p>
-<p>bar</p>
-</li>
+<li>foo    bar</li>
 </ul>

Example 78 (lines 1420-1433) Indented code blocks

1.  foo

    - bar
--- expected HTML
+++ actual HTML
@@ -1,8 +1,3 @@
 <ol>
-<li>
-<p>foo</p>
-<ul>
-<li>bar</li>
-</ul>
-</li>
+<li>foo    - bar</li>
 </ol>

Example 79 (lines 1440-1451) Indented code blocks

    <a/>
    *hi*

    - one
--- expected HTML
+++ actual HTML
@@ -1,5 +1,2 @@
-<pre><code>&lt;a/&gt;
-*hi*
-
-- one
+<pre><code>&lt;a/&gt;    *hi*    - one
 </code></pre>

Example 80 (lines 1456-1473) Indented code blocks

    chunk1

    chunk2
  
 
 
    chunk3
--- expected HTML
+++ actual HTML
@@ -1,8 +1,2 @@
-<pre><code>chunk1
-
-chunk2
-
-
-
-chunk3
+<pre><code>chunk1    chunk2        chunk3
 </code></pre>

Example 81 (lines 1479-1488) Indented code blocks

    chunk1
      
      chunk2
--- expected HTML
+++ actual HTML
@@ -1,4 +1,2 @@
-<pre><code>chunk1
-  
-  chunk2
+<pre><code>chunk1            chunk2
 </code></pre>

Example 83 (lines 1508-1515) Indented code blocks

    foo
bar
--- expected HTML
+++ actual HTML
@@ -1,3 +1,2 @@
-<pre><code>foo
+<pre><code>foobar
 </code></pre>
-<p>bar</p>

Example 84 (lines 1521-1536) Indented code blocks

# Heading
    foo
Heading
------
    foo
----
--- expected HTML
+++ actual HTML
@@ -1,7 +1 @@
-<h1>Heading</h1>
-<pre><code>foo
-</code></pre>
-<h2>Heading</h2>
-<pre><code>foo
-</code></pre>
-<hr />
+<h1>Heading    fooHeading------    foo----</h1>

Example 85 (lines 1541-1548) Indented code blocks

        foo
    bar
--- expected HTML
+++ actual HTML
@@ -1,3 +1,2 @@
-<pre><code>    foo
-bar
+<pre><code>    foo    bar
 </code></pre>

Example 86 (lines 1554-1563) Indented code blocks

    foo
--- expected HTML
+++ actual HTML
@@ -1,2 +1,2 @@
-<pre><code>foo
+<pre><code>    foo    
 </code></pre>

Example 88 (lines 1623-1632) Fenced code blocks

```
<
 >
```
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<pre><code>&lt;
- &gt;
-</code></pre>
+<p><code>&lt; &gt;</code></p>

Example 89 (lines 1637-1646) Fenced code blocks

~~~
<
 >
~~~
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<pre><code>&lt;
- &gt;
-</code></pre>
+<p>~~~&lt; &gt;~~~</p>

Example 91 (lines 1661-1670) Fenced code blocks

```
aaa
~~~
```
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<pre><code>aaa
-~~~
-</code></pre>
+<p><code>aaa~~~</code></p>

Example 92 (lines 1673-1682) Fenced code blocks

~~~
aaa
```
~~~
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<pre><code>aaa
-```
-</code></pre>
+<p>~~~aaa```~~~</p>

Example 93 (lines 1687-1696) Fenced code blocks

````
aaa
```
``````
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<pre><code>aaa
-```
-</code></pre>
+<p>````aaa`````````</p>

Example 94 (lines 1699-1708) Fenced code blocks

~~~~
aaa
~~~
~~~~
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<pre><code>aaa
-~~~
-</code></pre>
+<p>~~~~aaa~~~~~~~</p>

Example 96 (lines 1721-1731) Fenced code blocks

`````

```
aaa
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<pre><code>
-```
-aaa
-</code></pre>
+<pre><code class="language-aaa"></code></pre>

Example 97 (lines 1734-1745) Fenced code blocks

> ```
> aaa

bbb
--- expected HTML
+++ actual HTML
@@ -1,5 +1,3 @@
 <blockquote>
-<pre><code>aaa
-</code></pre>
+<pre><code class="language->"></code></pre>
 </blockquote>
-<p>bbb</p>

Example 98 (lines 1750-1759) Fenced code blocks

```

  
```
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<pre><code>
-  
-</code></pre>
+<p><code></code></p>

Example 100 (lines 1776-1785) Fenced code blocks

 ```
 aaa
aaa
```
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<pre><code>aaa
-aaa
-</code></pre>
+<p><code>aaaaaa</code></p>

Example 101 (lines 1788-1799) Fenced code blocks

  ```
aaa
  aaa
aaa
  ```
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<pre><code>aaa
-aaa
-aaa
-</code></pre>
+<p><code>aaa aaaaaa</code></p>

Example 102 (lines 1802-1813) Fenced code blocks

   ```
   aaa
    aaa
  aaa
   ```
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<pre><code>aaa
- aaa
-aaa
-</code></pre>
+<p><code>aaa aaa aaa</code></p>

Example 103 (lines 1818-1827) Fenced code blocks

    ```
    aaa
    ```
--- expected HTML
+++ actual HTML
@@ -1,4 +1,2 @@
-<pre><code>```
-aaa
-```
+<pre><code>```    aaa    ```
 </code></pre>

Example 104 (lines 1833-1840) Fenced code blocks

```
aaa
  ```
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<pre><code>aaa
-</code></pre>
+<p><code>aaa</code></p>

Example 105 (lines 1843-1850) Fenced code blocks

   ```
aaa
  ```
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<pre><code>aaa
-</code></pre>
+<p><code>aaa</code></p>

Example 106 (lines 1855-1863) Fenced code blocks

```
aaa
    ```
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<pre><code>aaa
-    ```
-</code></pre>
+<p><code>aaa</code></p>

Example 107 (lines 1869-1875) Fenced code blocks

``` ```
aaa
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p><code></code>
-aaa</p>
+<p><code></code>aaa</p>

Example 108 (lines 1878-1886) Fenced code blocks

~~~~~~
aaa
~~~ ~~
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<pre><code>aaa
-~~~ ~~
-</code></pre>
+<p>~~~~~~aaa~~~ ~~</p>

Example 109 (lines 1892-1903) Fenced code blocks

foo
```
bar
```
baz
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<p>foo</p>
-<pre><code>bar
-</code></pre>
-<p>baz</p>
+<p>foo<code>bar</code>baz</p>

Example 110 (lines 1909-1921) Fenced code blocks

foo
---
~~~
bar
~~~
# baz
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<h2>foo</h2>
-<pre><code>bar
-</code></pre>
-<h1>baz</h1>
+<p>foo---~~~bar~~~# baz</p>

Example 111 (lines 1929-1940) Fenced code blocks

```ruby
def foo(x)
  return 3
end
```
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<pre><code class="language-ruby">def foo(x)
-  return 3
-end
-</code></pre>
+<p><code>rubydef foo(x) return 3end</code></p>

Example 112 (lines 1943-1954) Fenced code blocks

~~~~    ruby startline=3 $%@#$
def foo(x)
  return 3
end
~~~~~~~
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<pre><code class="language-ruby">def foo(x)
-  return 3
-end
-</code></pre>
+<p>~~~~    ruby startline=3 $%@#$def foo(x)  return 3end~~~~~~~</p>

Example 113 (lines 1957-1962) Fenced code blocks

````;
````
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<pre><code class="language-;"></code></pre>
+<p><code>;</code></p>

Example 114 (lines 1967-1973) Fenced code blocks

``` aa ```
foo
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p><code>aa</code>
-foo</p>
+<p><code>aa</code>foo</p>

Example 115 (lines 1978-1985) Fenced code blocks

```
``` aaa
```
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<pre><code>``` aaa
-</code></pre>
+<p>`````` aaa```</p>

Example 116 (lines 2055-2070) HTML blocks

<table><tr><td>
<pre>
**Hello**,

_world_.
</pre>
</td></tr></table>
--- expected HTML
+++ actual HTML
@@ -1,6 +1 @@
-<table><tr><td>
-<pre>
-**Hello**,
-<p><em>world</em>.
-</pre></p>
-</td></tr></table>
+<table><tr><td><pre>**Hello**,_world_.</pre></td></tr></table>

Example 117 (lines 2084-2103) HTML blocks

<table>
  <tr>
    <td>
           hi
    </td>
  </tr>
</table>

okay.
--- expected HTML
+++ actual HTML
@@ -1,8 +1 @@
-<table>
-  <tr>
-    <td>
-           hi
-    </td>
-  </tr>
-</table>
-<p>okay.</p>
+<table>  <tr>    <td>           hi    </td>  </tr></table>okay.

Example 120 (lines 2130-2140) HTML blocks

<DIV CLASS="foo">

*Markdown*

</DIV>
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<DIV CLASS="foo">
-<p><em>Markdown</em></p>
-</DIV>
+<DIV CLASS="foo">*Markdown*</DIV>

Example 122 (lines 2157-2165) HTML blocks

<div id="foo" class="bar
  baz">
</div>
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<div id="foo" class="bar
-  baz">
-</div>
+<div id="foo" class="bar  baz"></div>

Example 123 (lines 2169-2178) HTML blocks

<div>
*foo*

*bar*
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<div>
-*foo*
-<p><em>bar</em></p>
+<div>*foo**bar*

Example 124 (lines 2185-2191) HTML blocks

<div id="foo"
*hi*
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<div id="foo"
-*hi*
+<div id="foo"*hi*

Example 125 (lines 2194-2200) HTML blocks

<div class
foo
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<div class
-foo
+<div classfoo

Example 126 (lines 2206-2212) HTML blocks

<div *???-&&&-<---
*foo*
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<div *???-&&&-<---
-*foo*
+<div *???-&&&-<---*foo*

Example 129 (lines 2242-2252) HTML blocks

<div></div>
``` c
int x = 33;
```
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<div></div>
-``` c
-int x = 33;
-```
+<div></div>``` cint x = 33;```

Example 130 (lines 2259-2267) HTML blocks

<a href="foo">
*bar*
</a>
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<a href="foo">
-*bar*
-</a>
+<p><a href="foo"><em>bar</em></a></p>

Example 131 (lines 2272-2280) HTML blocks

<Warning>
*bar*
</Warning>
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<Warning>
-*bar*
-</Warning>
+<p><Warning><em>bar</em></Warning></p>

Example 132 (lines 2283-2291) HTML blocks

<i class="foo">
*bar*
</i>
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<i class="foo">
-*bar*
-</i>
+<p><i class="foo"><em>bar</em></i></p>

Example 133 (lines 2294-2300) HTML blocks

</ins>
*bar*
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-</ins>
-*bar*
+<p></ins><em>bar</em></p>

Example 134 (lines 2309-2317) HTML blocks

<del>
*foo*
</del>
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<del>
-*foo*
-</del>
+<p><del><em>foo</em></del></p>

Example 135 (lines 2324-2334) HTML blocks

<del>

*foo*

</del>
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<del>
-<p><em>foo</em></p>
-</del>
+<p><del><em>foo</em></del></p>

Example 137 (lines 2358-2374) HTML blocks

<pre language="haskell"><code>
import Text.HTML.TagSoup

main :: IO ()
main = print $ parseTags tags
</code></pre>
okay
--- expected HTML
+++ actual HTML
@@ -1,7 +1 @@
-<pre language="haskell"><code>
-import Text.HTML.TagSoup
-
-main :: IO ()
-main = print $ parseTags tags
-</code></pre>
-<p>okay</p>
+<pre language="haskell"><code>import Text.HTML.TagSoupmain :: IO ()main = print $ parseTags tags</code></pre>okay

Example 138 (lines 2379-2393) HTML blocks

<script type="text/javascript">
// JavaScript example

document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>
okay
--- expected HTML
+++ actual HTML
@@ -1,6 +1 @@
-<script type="text/javascript">
-// JavaScript example
-
-document.getElementById("demo").innerHTML = "Hello JavaScript!";
-</script>
-<p>okay</p>
+<script type="text/javascript">// JavaScript exampledocument.getElementById("demo").innerHTML = "Hello JavaScript!";</script>okay

Example 139 (lines 2398-2414) HTML blocks

<style
  type="text/css">
h1 {color:red;}

p {color:blue;}
</style>
okay
--- expected HTML
+++ actual HTML
@@ -1,7 +1 @@
-<style
-  type="text/css">
-h1 {color:red;}
-
-p {color:blue;}
-</style>
-<p>okay</p>
+<style  type="text/css">h1 {color:red;}p {color:blue;}</style>okay

Example 141 (lines 2434-2445) HTML blocks

> <div>
> foo

bar
--- expected HTML
+++ actual HTML
@@ -1,5 +1,3 @@
 <blockquote>
-<div>
-foo
+<div>> foobar
 </blockquote>
-<p>bar</p>

Example 142 (lines 2448-2458) HTML blocks

- <div>
- foo
--- expected HTML
+++ actual HTML
@@ -1,6 +1,5 @@
 <ul>
 <li>
-<div>
+<div>- foo
 </li>
-<li>foo</li>
 </ul>

Example 143 (lines 2463-2469) HTML blocks

<style>p{color:red;}</style>
*foo*
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<style>p{color:red;}</style>
-<p><em>foo</em></p>
+<style>p{color:red;}</style>*foo*

Example 144 (lines 2472-2478) HTML blocks

<!-- foo -->*bar*
*baz*
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<!-- foo -->*bar*
-<p><em>baz</em></p>
+<!-- foo -->*bar**baz*

Example 146 (lines 2497-2509) HTML blocks

<!-- Foo

bar
   baz -->
okay
--- expected HTML
+++ actual HTML
@@ -1,5 +1 @@
-<!-- Foo
-
-bar
-   baz -->
-<p>okay</p>
+<!-- Foobar   baz -->okay

Example 147 (lines 2515-2529) HTML blocks

<?php

  echo '>';

?>
okay
--- expected HTML
+++ actual HTML
@@ -1,6 +1 @@
-<?php
-
-  echo '>';
-
-?>
-<p>okay</p>
+<?php  echo '>';?>okay

Example 149 (lines 2543-2571) HTML blocks

<![CDATA[
function matchwo(a,b)
{
  if (a < b && a < 0) then {
    return 1;

  } else {

    return 0;
  }
}
]]>
okay
--- expected HTML
+++ actual HTML
@@ -1,13 +1 @@
-<![CDATA[
-function matchwo(a,b)
-{
-  if (a < b && a < 0) then {
-    return 1;
-
-  } else {
-
-    return 0;
-  }
-}
-]]>
-<p>okay</p>
+<![CDATA[function matchwo(a,b){  if (a < b && a < 0) then {    return 1;  } else {    return 0;  }}]]>okay

Example 150 (lines 2576-2584) HTML blocks

  <!-- foo -->

    <!-- foo -->
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-  <!-- foo -->
-<pre><code>&lt;!-- foo --&gt;
-</code></pre>
+  <!-- foo -->    <!-- foo -->

Example 151 (lines 2587-2595) HTML blocks

  <div>

    <div>
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-  <div>
-<pre><code>&lt;div&gt;
-</code></pre>
+  <div>    <div>

Example 152 (lines 2601-2611) HTML blocks

Foo
<div>
bar
</div>
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<p>Foo</p>
-<div>
-bar
-</div>
+<p>Foo<div>bar</div></p>

Example 154 (lines 2632-2640) HTML blocks

Foo
<a href="bar">
baz
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<p>Foo
-<a href="bar">
-baz</p>
+<p>Foo<a href="bar">baz</p>

Example 155 (lines 2673-2683) HTML blocks

<div>

*Emphasized* text.

</div>
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<div>
-<p><em>Emphasized</em> text.</p>
-</div>
+<div>*Emphasized* text.</div>

Example 158 (lines 2735-2756) HTML blocks

<table>

  <tr>

    <td>
      Hi
    </td>

  </tr>

</table>
--- expected HTML
+++ actual HTML
@@ -1,8 +1 @@
-<table>
-  <tr>
-<pre><code>&lt;td&gt;
-  Hi
-&lt;/td&gt;
-</code></pre>
-  </tr>
-</table>
+<table>  <tr>    <td>      Hi    </td>  </tr></table>

Example 159 (lines 2783-2789) Link reference definitions

[foo]: /url "title"

[foo]
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url" title="title">foo</a></p>
+<p>[foo]: /url &quot;title&quot;[foo]</p>

Example 160 (lines 2792-2800) Link reference definitions

   [foo]: 
      /url  
           'the title'  

[foo]
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url" title="the title">foo</a></p>
+<p>[foo]:       /url             'the title'  [foo]</p>

Example 161 (lines 2803-2809) Link reference definitions

[Foo*bar\]]:my_(url) 'title (with parens)'

[Foo*bar\]]
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="my_(url)" title="title (with parens)">Foo*bar]</a></p>
+<p>[Foo<em>bar]]:my_(url) 'title (with parens)'[Foo</em>bar]]</p>

Example 162 (lines 2812-2820) Link reference definitions

[Foo bar]:
<my%20url>
'title'

[Foo bar]
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="my%20url" title="title">Foo bar</a></p>
+<p>[Foo bar]:&lt;my%20url&gt;'title'[Foo bar]</p>

Example 163 (lines 2825-2839) Link reference definitions

[foo]: /url '
title
line1
line2
'

[foo]
--- expected HTML
+++ actual HTML
@@ -1,5 +1 @@
-<p><a href="/url" title="
-title
-line1
-line2
-">foo</a></p>
+<p>[foo]: /url 'titleline1line2'[foo]</p>

Example 164 (lines 2844-2854) Link reference definitions

[foo]: /url 'title

with blank line'

[foo]
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<p>[foo]: /url 'title</p>
-<p>with blank line'</p>
-<p>[foo]</p>
+<p>[foo]: /url 'titlewith blank line'[foo]</p>

Example 165 (lines 2859-2866) Link reference definitions

[foo]:
/url

[foo]
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url">foo</a></p>
+

Example 166 (lines 2871-2878) Link reference definitions

[foo]:

[foo]
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>[foo]:</p>
-<p>[foo]</p>
+

Example 167 (lines 2884-2890) Link reference definitions

[foo]: /url\bar\*baz "foo\"bar\baz"

[foo]
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url%5Cbar*baz" title="foo&quot;bar\baz">foo</a></p>
+<p>[foo]: /url\bar*baz &quot;foo&quot;bar\baz&quot;[foo]</p>

Example 168 (lines 2895-2901) Link reference definitions

[foo]

[foo]: url
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="url">foo</a></p>
+<p>[foo][foo]: url</p>

Example 169 (lines 2907-2914) Link reference definitions

[foo]

[foo]: first
[foo]: second
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="first">foo</a></p>
+<p>[foo][foo]: first[foo]: second</p>

Example 170 (lines 2920-2926) Link reference definitions

[FOO]: /url

[Foo]
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url">Foo</a></p>
+

Example 171 (lines 2929-2935) Link reference definitions

[ΑΓΩ]: /φου

[αγω]
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/%CF%86%CE%BF%CF%85">αγω</a></p>
+

Example 172 (lines 2941-2944) Link reference definitions

[foo]: /url
--- expected HTML
+++ actual HTML
@@ -0,0 +1 @@
+

Example 173 (lines 2949-2956) Link reference definitions

[
foo
]: /url
bar
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>bar</p>
+

Example 175 (lines 2971-2976) Link reference definitions

[foo]: /url
"title" ok
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>&quot;title&quot; ok</p>
+<p>[foo]: /url&quot;title&quot; ok</p>

Example 176 (lines 2982-2990) Link reference definitions

    [foo]: /url "title"

[foo]
--- expected HTML
+++ actual HTML
@@ -1,3 +1,2 @@
-<pre><code>[foo]: /url &quot;title&quot;
+<pre><code>[foo]: /url &quot;title&quot;[foo]
 </code></pre>
-<p>[foo]</p>

Example 177 (lines 2996-3006) Link reference definitions

```
[foo]: /url
```

[foo]
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<pre><code>[foo]: /url
-</code></pre>
-<p>[foo]</p>
+<p><code>[foo]: /url</code>[foo]</p>

Example 178 (lines 3011-3020) Link reference definitions

Foo
[bar]: /baz

[bar]
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<p>Foo
-[bar]: /baz</p>
-<p>[bar]</p>
+<p>Foo[bar]: /baz[bar]</p>

Example 179 (lines 3026-3035) Link reference definitions

# [Foo]
[foo]: /url
> bar
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<h1><a href="/url">Foo</a></h1>
-<blockquote>
-<p>bar</p>
-</blockquote>
+<h1>[Foo][foo]: /url&gt; bar</h1>

Example 180 (lines 3041-3054) Link reference definitions

[foo]: /foo-url "foo"
[bar]: /bar-url
  "bar"
[baz]: /baz-url

[foo],
[bar],
[baz]
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<p><a href="/foo-url" title="foo">foo</a>,
-<a href="/bar-url" title="bar">bar</a>,
-<a href="/baz-url">baz</a></p>
+<p>[foo]: /foo-url &quot;foo&quot;[bar]: /bar-url  &quot;bar&quot;[baz]: /baz-url[foo],[bar],[baz]</p>

Example 181 (lines 3062-3070) Link reference definitions

[foo]

> [foo]: /url
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<p><a href="/url">foo</a></p>
-<blockquote>
-</blockquote>
+<p>[foo]&gt; [foo]: /url</p>

Example 182 (lines 3085-3092) Paragraphs

aaa

bbb
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>aaa</p>
-<p>bbb</p>
+<p>aaabbb</p>

Example 183 (lines 3097-3108) Paragraphs

aaa
bbb

ccc
ddd
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<p>aaa
-bbb</p>
-<p>ccc
-ddd</p>
+<p>aaabbbcccddd</p>

Example 184 (lines 3113-3121) Paragraphs

aaa


bbb
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>aaa</p>
-<p>bbb</p>
+<p>aaabbb</p>

Example 187 (lines 3152-3158) Paragraphs

   aaa
bbb
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>aaa
-bbb</p>
+<p>aaabbb</p>

Example 188 (lines 3161-3168) Paragraphs

    aaa
bbb
--- expected HTML
+++ actual HTML
@@ -1,3 +1,2 @@
-<pre><code>aaa
+<pre><code>aaabbb
 </code></pre>
-<p>bbb</p>

Example 189 (lines 3175-3181) Paragraphs

aaa     
bbb     
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>aaa<br />
-bbb</p>
+<p>aaa     bbb</p>

Example 190 (lines 3192-3204) Blank lines

aaa
  

# aaa
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>aaa</p>
-<h1>aaa</h1>
+<p>aaa  # aaa</p>

Example 191 (lines 3258-3268) Block quotes

> # Foo
> bar
> baz
--- expected HTML
+++ actual HTML
@@ -1,5 +1,3 @@
 <blockquote>
-<h1>Foo</h1>
-<p>bar
-baz</p>
+<h1>Foo&gt; bar&gt; baz</h1>
 </blockquote>

Example 192 (lines 3273-3283) Block quotes

># Foo
>bar
> baz
--- expected HTML
+++ actual HTML
@@ -1,5 +1,3 @@
 <blockquote>
-<h1>Foo</h1>
-<p>bar
-baz</p>
+<h1>Foo&gt;bar&gt; baz</h1>
 </blockquote>

Example 193 (lines 3288-3298) Block quotes

   > # Foo
   > bar
 > baz
--- expected HTML
+++ actual HTML
@@ -1,5 +1,3 @@
 <blockquote>
-<h1>Foo</h1>
-<p>bar
-baz</p>
+<h1>Foo   &gt; bar &gt; baz</h1>
 </blockquote>

Example 194 (lines 3303-3312) Block quotes

    > # Foo
    > bar
    > baz
--- expected HTML
+++ actual HTML
@@ -1,4 +1,2 @@
-<pre><code>&gt; # Foo
-&gt; bar
-&gt; baz
+<pre><code>&gt; # Foo    &gt; bar    &gt; baz
 </code></pre>

Example 195 (lines 3318-3328) Block quotes

> # Foo
> bar
baz
--- expected HTML
+++ actual HTML
@@ -1,5 +1,3 @@
 <blockquote>
-<h1>Foo</h1>
-<p>bar
-baz</p>
+<h1>Foo&gt; barbaz</h1>
 </blockquote>

Example 196 (lines 3334-3344) Block quotes

> bar
baz
> foo
--- expected HTML
+++ actual HTML
@@ -1,5 +1,3 @@
 <blockquote>
-<p>bar
-baz
-foo</p>
+<p>barbaz&gt; foo</p>
 </blockquote>

Example 197 (lines 3358-3366) Block quotes

> foo
---
--- expected HTML
+++ actual HTML
@@ -1,4 +1,3 @@
 <blockquote>
-<p>foo</p>
+<p>foo---</p>
 </blockquote>
-<hr />

Example 198 (lines 3378-3390) Block quotes

> - foo
- bar
--- expected HTML
+++ actual HTML
@@ -1,8 +1,5 @@
 <blockquote>
 <ul>
-<li>foo</li>
+<li>foo- bar</li>
 </ul>
 </blockquote>
-<ul>
-<li>bar</li>
-</ul>

Example 199 (lines 3396-3406) Block quotes

>     foo
    bar
--- expected HTML
+++ actual HTML
@@ -1,6 +1,4 @@
 <blockquote>
-<pre><code>foo
+<pre><code>foo    bar
 </code></pre>
 </blockquote>
-<pre><code>bar
-</code></pre>

Example 200 (lines 3409-3419) Block quotes

> ```
foo
```
--- expected HTML
+++ actual HTML
@@ -1,5 +1,3 @@
 <blockquote>
-<pre><code></code></pre>
+<p><code>foo</code></p>
 </blockquote>
-<p>foo</p>
-<pre><code></code></pre>

Example 203 (lines 3457-3464) Block quotes

>
>  
> 
--- expected HTML
+++ actual HTML
@@ -1,2 +1,6 @@
+<blockquote>
+<blockquote>
 <blockquote>
 </blockquote>
+</blockquote>
+</blockquote>

Example 204 (lines 3469-3477) Block quotes

>
> foo
>  
--- expected HTML
+++ actual HTML
@@ -1,3 +1,5 @@
 <blockquote>
-<p>foo</p>
+<blockquote>
+<p>foo&gt;</p>
 </blockquote>
+</blockquote>

Example 205 (lines 3482-3493) Block quotes

> foo

> bar
--- expected HTML
+++ actual HTML
@@ -1,6 +1,3 @@
 <blockquote>
-<p>foo</p>
+<p>foo&gt; bar</p>
 </blockquote>
-<blockquote>
-<p>bar</p>
-</blockquote>

Example 206 (lines 3504-3512) Block quotes

> foo
> bar
--- expected HTML
+++ actual HTML
@@ -1,4 +1,3 @@
 <blockquote>
-<p>foo
-bar</p>
+<p>foo&gt; bar</p>
 </blockquote>

Example 207 (lines 3517-3526) Block quotes

> foo
>
> bar
--- expected HTML
+++ actual HTML
@@ -1,4 +1,3 @@
 <blockquote>
-<p>foo</p>
-<p>bar</p>
+<p>foo&gt;&gt; bar</p>
 </blockquote>

Example 208 (lines 3531-3539) Block quotes

foo
> bar
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<p>foo</p>
-<blockquote>
-<p>bar</p>
-</blockquote>
+<p>foo&gt; bar</p>

Example 209 (lines 3545-3557) Block quotes

> aaa
***
> bbb
--- expected HTML
+++ actual HTML
@@ -1,7 +1,3 @@
 <blockquote>
-<p>aaa</p>
+<p>aaa***&gt; bbb</p>
 </blockquote>
-<hr />
-<blockquote>
-<p>bbb</p>
-</blockquote>

Example 210 (lines 3563-3571) Block quotes

> bar
baz
--- expected HTML
+++ actual HTML
@@ -1,4 +1,3 @@
 <blockquote>
-<p>bar
-baz</p>
+<p>barbaz</p>
 </blockquote>

Example 211 (lines 3574-3583) Block quotes

> bar

baz
--- expected HTML
+++ actual HTML
@@ -1,4 +1,3 @@
 <blockquote>
-<p>bar</p>
+<p>barbaz</p>
 </blockquote>
-<p>baz</p>

Example 212 (lines 3586-3595) Block quotes

> bar
>
baz
--- expected HTML
+++ actual HTML
@@ -1,4 +1,3 @@
 <blockquote>
-<p>bar</p>
+<p>bar&gt;baz</p>
 </blockquote>
-<p>baz</p>

Example 213 (lines 3602-3614) Block quotes

> > > foo
bar
--- expected HTML
+++ actual HTML
@@ -1,8 +1,7 @@
 <blockquote>
 <blockquote>
 <blockquote>
-<p>foo
-bar</p>
+<p>foobar</p>
 </blockquote>
 </blockquote>
 </blockquote>

Example 214 (lines 3617-3631) Block quotes

>>> foo
> bar
>>baz
--- expected HTML
+++ actual HTML
@@ -1,9 +1,7 @@
 <blockquote>
 <blockquote>
 <blockquote>
-<p>foo
-bar
-baz</p>
+<p>foo&gt; bar&gt;&gt;baz</p>
 </blockquote>
 </blockquote>
 </blockquote>

Example 215 (lines 3639-3651) Block quotes

>     code

>    not code
--- expected HTML
+++ actual HTML
@@ -1,7 +1,4 @@
 <blockquote>
-<pre><code>code
+<pre><code>code&gt;    not code
 </code></pre>
 </blockquote>
-<blockquote>
-<p>not code</p>
-</blockquote>

Example 216 (lines 3694-3709) List items

A paragraph
with two lines.

    indented code

> A block quote.
--- expected HTML
+++ actual HTML
@@ -1,7 +1 @@
-<p>A paragraph
-with two lines.</p>
-<pre><code>indented code
-</code></pre>
-<blockquote>
-<p>A block quote.</p>
-</blockquote>
+<p>A paragraphwith two lines.    indented code&gt; A block quote.</p>

Example 217 (lines 3716-3735) List items

1.  A paragraph
    with two lines.

        indented code

    > A block quote.
--- expected HTML
+++ actual HTML
@@ -1,11 +1,3 @@
 <ol>
-<li>
-<p>A paragraph
-with two lines.</p>
-<pre><code>indented code
-</code></pre>
-<blockquote>
-<p>A block quote.</p>
-</blockquote>
-</li>
+<li>A paragraph    with two lines.        indented code    &gt; A block quote.</li>
 </ol>

Example 218 (lines 3749-3758) List items

- one

 two
--- expected HTML
+++ actual HTML
@@ -1,4 +1,3 @@
 <ul>
-<li>one</li>
+<li>one two</li>
 </ul>
-<p>two</p>

Example 219 (lines 3761-3772) List items

- one

  two
--- expected HTML
+++ actual HTML
@@ -1,6 +1,3 @@
 <ul>
-<li>
-<p>one</p>
-<p>two</p>
-</li>
+<li>one  two</li>
 </ul>

Example 220 (lines 3775-3785) List items

 -    one

     two
--- expected HTML
+++ actual HTML
@@ -1,5 +1,3 @@
 <ul>
-<li>one</li>
+<li>one     two</li>
 </ul>
-<pre><code> two
-</code></pre>

Example 221 (lines 3788-3799) List items

 -    one

      two
--- expected HTML
+++ actual HTML
@@ -1,6 +1,3 @@
 <ul>
-<li>
-<p>one</p>
-<p>two</p>
-</li>
+<li>one      two</li>
 </ul>

Example 222 (lines 3810-3825) List items

   > > 1.  one
>>
>>     two
--- expected HTML
+++ actual HTML
@@ -1,10 +1,7 @@
 <blockquote>
 <blockquote>
 <ol>
-<li>
-<p>one</p>
-<p>two</p>
-</li>
+<li>one&gt;&gt;&gt;&gt;     two</li>
 </ol>
 </blockquote>
 </blockquote>

Example 223 (lines 3837-3850) List items

>>- one
>>
  >  > two
--- expected HTML
+++ actual HTML
@@ -1,8 +1,7 @@
 <blockquote>
 <blockquote>
 <ul>
-<li>one</li>
+<li>one&gt;&gt;  &gt;  &gt; two</li>
 </ul>
-<p>two</p>
 </blockquote>
 </blockquote>

Example 224 (lines 3856-3863) List items

-one

2.two
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>-one</p>
-<p>2.two</p>
+<p>-one2.two</p>

Example 225 (lines 3869-3881) List items

- foo


  bar
--- expected HTML
+++ actual HTML
@@ -1,6 +1,3 @@
 <ul>
-<li>
-<p>foo</p>
-<p>bar</p>
-</li>
+<li>foo  bar</li>
 </ul>

Example 226 (lines 3886-3908) List items

1.  foo

    ```
    bar
    ```

    baz

    > bam
--- expected HTML
+++ actual HTML
@@ -1,11 +1,3 @@
 <ol>
-<li>
-<p>foo</p>
-<pre><code>bar
-</code></pre>
-<p>baz</p>
-<blockquote>
-<p>bam</p>
-</blockquote>
-</li>
+<li>foo    <code>bar</code>    baz    &gt; bam</li>
 </ol>

Example 227 (lines 3914-3932) List items

- Foo

      bar


      baz
--- expected HTML
+++ actual HTML
@@ -1,10 +1,3 @@
 <ul>
-<li>
-<p>Foo</p>
-<pre><code>bar
-
-
-baz
-</code></pre>
-</li>
+<li>Foo      bar      baz</li>
 </ul>

Example 233 (lines 3998-4010) List items

- foo

      bar
--- expected HTML
+++ actual HTML
@@ -1,7 +1,3 @@
 <ul>
-<li>
-<p>foo</p>
-<pre><code>bar
-</code></pre>
-</li>
+<li>foo      bar</li>
 </ul>

Example 234 (lines 4015-4027) List items

  10.  foo

           bar
--- expected HTML
+++ actual HTML
@@ -1,7 +1,3 @@
 <ol start="10">
-<li>
-<p>foo</p>
-<pre><code>bar
-</code></pre>
-</li>
+<li>foo           bar</li>
 </ol>

Example 235 (lines 4034-4046) List items

    indented code

paragraph

    more code
--- expected HTML
+++ actual HTML
@@ -1,5 +1,2 @@
-<pre><code>indented code
+<pre><code>indented codeparagraph    more code
 </code></pre>
-<p>paragraph</p>
-<pre><code>more code
-</code></pre>

Example 236 (lines 4049-4065) List items

1.     indented code

   paragraph

       more code
--- expected HTML
+++ actual HTML
@@ -1,9 +1,6 @@
 <ol>
 <li>
-<pre><code>indented code
-</code></pre>
-<p>paragraph</p>
-<pre><code>more code
+<pre><code>indented code   paragraph       more code
 </code></pre>
 </li>
 </ol>

Example 237 (lines 4071-4087) List items

1.      indented code

   paragraph

       more code
--- expected HTML
+++ actual HTML
@@ -1,9 +1,6 @@
 <ol>
 <li>
-<pre><code> indented code
-</code></pre>
-<p>paragraph</p>
-<pre><code>more code
+<pre><code> indented code   paragraph       more code
 </code></pre>
 </li>
 </ol>

Example 238 (lines 4098-4105) List items

   foo

bar
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>foo</p>
-<p>bar</p>
+<p>foobar</p>

Example 239 (lines 4108-4117) List items

-    foo

  bar
--- expected HTML
+++ actual HTML
@@ -1,4 +1,3 @@
 <ul>
-<li>foo</li>
+<li>foo  bar</li>
 </ul>
-<p>bar</p>

Example 240 (lines 4125-4136) List items

-  foo

   bar
--- expected HTML
+++ actual HTML
@@ -1,6 +1,3 @@
 <ul>
-<li>
-<p>foo</p>
-<p>bar</p>
-</li>
+<li>foo   bar</li>
 </ul>

Example 241 (lines 4153-4174) List items

-
  foo
-
  ```
  bar
  ```
-
      baz
--- expected HTML
+++ actual HTML
@@ -1,11 +1,3 @@
 <ul>
-<li>foo</li>
-<li>
-<pre><code>bar
-</code></pre>
-</li>
-<li>
-<pre><code>baz
-</code></pre>
-</li>
+<li>foo-  <code>bar</code>-      baz</li>
 </ul>

Example 242 (lines 4179-4186) List items

-   
  foo
--- expected HTML
+++ actual HTML
@@ -1,3 +1,6 @@
 <ul>
-<li>foo</li>
+<li>
+<pre><code>foo
+</code></pre>
+</li>
 </ul>

Example 243 (lines 4193-4202) List items

-

  foo
--- expected HTML
+++ actual HTML
@@ -1,4 +1,3 @@
 <ul>
-<li></li>
+<li>foo</li>
 </ul>
-<p>foo</p>

Example 244 (lines 4207-4217) List items

- foo
-
- bar
--- expected HTML
+++ actual HTML
@@ -1,5 +1,3 @@
 <ul>
-<li>foo</li>
-<li></li>
-<li>bar</li>
+<li>foo-- bar</li>
 </ul>

Example 245 (lines 4222-4232) List items

- foo
-   
- bar
--- expected HTML
+++ actual HTML
@@ -1,5 +1,3 @@
 <ul>
-<li>foo</li>
-<li></li>
-<li>bar</li>
+<li>foo-   - bar</li>
 </ul>

Example 246 (lines 4237-4247) List items

1. foo
2.
3. bar
--- expected HTML
+++ actual HTML
@@ -1,5 +1,3 @@
 <ol>
-<li>foo</li>
-<li></li>
-<li>bar</li>
+<li>foo2.3. bar</li>
 </ol>

Example 248 (lines 4262-4273) List items

foo
*

foo
1.
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<p>foo
-*</p>
-<p>foo
-1.</p>
+<p>foo*foo1.</p>

Example 249 (lines 4284-4303) List items

 1.  A paragraph
     with two lines.

         indented code

     > A block quote.
--- expected HTML
+++ actual HTML
@@ -1,11 +1,3 @@
 <ol>
-<li>
-<p>A paragraph
-with two lines.</p>
-<pre><code>indented code
-</code></pre>
-<blockquote>
-<p>A block quote.</p>
-</blockquote>
-</li>
+<li>A paragraph     with two lines.         indented code     &gt; A block quote.</li>
 </ol>

Example 250 (lines 4308-4327) List items

  1.  A paragraph
      with two lines.

          indented code

      > A block quote.
--- expected HTML
+++ actual HTML
@@ -1,11 +1,3 @@
 <ol>
-<li>
-<p>A paragraph
-with two lines.</p>
-<pre><code>indented code
-</code></pre>
-<blockquote>
-<p>A block quote.</p>
-</blockquote>
-</li>
+<li>A paragraph      with two lines.          indented code      &gt; A block quote.</li>
 </ol>

Example 251 (lines 4332-4351) List items

   1.  A paragraph
       with two lines.

           indented code

       > A block quote.
--- expected HTML
+++ actual HTML
@@ -1,11 +1,3 @@
 <ol>
-<li>
-<p>A paragraph
-with two lines.</p>
-<pre><code>indented code
-</code></pre>
-<blockquote>
-<p>A block quote.</p>
-</blockquote>
-</li>
+<li>A paragraph       with two lines.           indented code       &gt; A block quote.</li>
 </ol>

Example 252 (lines 4356-4371) List items

    1.  A paragraph
        with two lines.

            indented code

        > A block quote.
--- expected HTML
+++ actual HTML
@@ -1,7 +1,2 @@
-<pre><code>1.  A paragraph
-    with two lines.
-
-        indented code
-
-    &gt; A block quote.
+<pre><code>1.  A paragraph        with two lines.            indented code        &gt; A block quote.
 </code></pre>

Example 253 (lines 4386-4405) List items

  1.  A paragraph
with two lines.

          indented code

      > A block quote.
--- expected HTML
+++ actual HTML
@@ -1,11 +1,3 @@
 <ol>
-<li>
-<p>A paragraph
-with two lines.</p>
-<pre><code>indented code
-</code></pre>
-<blockquote>
-<p>A block quote.</p>
-</blockquote>
-</li>
+<li>A paragraphwith two lines.          indented code      &gt; A block quote.</li>
 </ol>

Example 255 (lines 4423-4437) List items

> 1. > Blockquote
continued here.
--- expected HTML
+++ actual HTML
@@ -2,8 +2,7 @@
 <ol>
 <li>
 <blockquote>
-<p>Blockquote
-continued here.</p>
+<p>Blockquotecontinued here.</p>
 </blockquote>
 </li>
 </ol>

Example 256 (lines 4440-4454) List items

> 1. > Blockquote
> continued here.
--- expected HTML
+++ actual HTML
@@ -2,8 +2,7 @@
 <ol>
 <li>
 <blockquote>
-<p>Blockquote
-continued here.</p>
+<p>Blockquote&gt; continued here.</p>
 </blockquote>
 </li>
 </ol>

Example 257 (lines 4467-4488) List items

- foo
  - bar
    - baz
      - boo
--- expected HTML
+++ actual HTML
@@ -1,15 +1,3 @@
 <ul>
-<li>foo
-<ul>
-<li>bar
-<ul>
-<li>baz
-<ul>
-<li>boo</li>
+<li>foo  - bar    - baz      - boo</li>
 </ul>
-</li>
-</ul>
-</li>
-</ul>
-</li>
-</ul>

Example 258 (lines 4493-4505) List items

- foo
 - bar
  - baz
   - boo
--- expected HTML
+++ actual HTML
@@ -1,6 +1,3 @@
 <ul>
-<li>foo</li>
-<li>bar</li>
-<li>baz</li>
-<li>boo</li>
+<li>foo - bar  - baz   - boo</li>
 </ul>

Example 259 (lines 4510-4521) List items

10) foo
    - bar
--- expected HTML
+++ actual HTML
@@ -1,7 +1,3 @@
 <ol start="10">
-<li>foo
-<ul>
-<li>bar</li>
-</ul>
-</li>
+<li>foo    - bar</li>
 </ol>

Example 260 (lines 4526-4536) List items

10) foo
   - bar
--- expected HTML
+++ actual HTML
@@ -1,6 +1,3 @@
 <ol start="10">
-<li>foo</li>
+<li>foo   - bar</li>
 </ol>
-<ul>
-<li>bar</li>
-</ul>

Example 263 (lines 4573-4587) List items

- # Foo
- Bar
  ---
  baz
--- expected HTML
+++ actual HTML
@@ -1,8 +1,5 @@
 <ul>
 <li>
-<h1>Foo</h1>
+<h1>Foo- Bar  ---  baz</h1>
 </li>
-<li>
-<h2>Bar</h2>
-baz</li>
 </ul>

Example 264 (lines 4809-4821) Lists

- foo
- bar
+ baz
--- expected HTML
+++ actual HTML
@@ -1,7 +1,3 @@
 <ul>
-<li>foo</li>
-<li>bar</li>
+<li>foo- bar+ baz</li>
 </ul>
-<ul>
-<li>baz</li>
-</ul>

Example 265 (lines 4824-4836) Lists

1. foo
2. bar
3) baz
--- expected HTML
+++ actual HTML
@@ -1,7 +1,3 @@
 <ol>
-<li>foo</li>
-<li>bar</li>
+<li>foo2. bar3) baz</li>
 </ol>
-<ol start="3">
-<li>baz</li>
-</ol>

Example 266 (lines 4843-4853) Lists

Foo
- bar
- baz
--- expected HTML
+++ actual HTML
@@ -1,5 +1 @@
-<p>Foo</p>
-<ul>
-<li>bar</li>
-<li>baz</li>
-</ul>
+<p>Foo- bar- baz</p>

Example 267 (lines 4920-4926) Lists

The number of windows in my house is
14.  The number of doors is 6.
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>The number of windows in my house is
-14.  The number of doors is 6.</p>
+<p>The number of windows in my house is14.  The number of doors is 6.</p>

Example 268 (lines 4930-4938) Lists

The number of windows in my house is
1.  The number of doors is 6.
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<p>The number of windows in my house is</p>
-<ol>
-<li>The number of doors is 6.</li>
-</ol>
+<p>The number of windows in my house is1.  The number of doors is 6.</p>

Example 269 (lines 4944-4963) Lists

- foo

- bar


- baz
--- expected HTML
+++ actual HTML
@@ -1,11 +1,3 @@
 <ul>
-<li>
-<p>foo</p>
-</li>
-<li>
-<p>bar</p>
-</li>
-<li>
-<p>baz</p>
-</li>
+<li>foo- bar- baz</li>
 </ul>

Example 270 (lines 4965-4987) Lists

- foo
  - bar
    - baz


      bim
--- expected HTML
+++ actual HTML
@@ -1,14 +1,3 @@
 <ul>
-<li>foo
-<ul>
-<li>bar
-<ul>
-<li>
-<p>baz</p>
-<p>bim</p>
-</li>
+<li>foo  - bar    - baz      bim</li>
 </ul>
-</li>
-</ul>
-</li>
-</ul>

Example 271 (lines 4995-5013) Lists

- foo
- bar

<!-- -->

- baz
- bim
--- expected HTML
+++ actual HTML
@@ -1,9 +1,3 @@
 <ul>
-<li>foo</li>
-<li>bar</li>
+<li>foo- bar<!-- -->- baz- bim</li>
 </ul>
-<!-- -->
-<ul>
-<li>baz</li>
-<li>bim</li>
-</ul>

Example 272 (lines 5016-5039) Lists

-   foo

    notcode

-   foo

<!-- -->

    code
--- expected HTML
+++ actual HTML
@@ -1,12 +1,3 @@
 <ul>
-<li>
-<p>foo</p>
-<p>notcode</p>
-</li>
-<li>
-<p>foo</p>
-</li>
+<li>foo    notcode-   foo<!-- -->    code</li>
 </ul>
-<!-- -->
-<pre><code>code
-</code></pre>

Example 273 (lines 5047-5069) Lists

- a
 - b
  - c
   - d
    - e
   - f
  - g
 - h
- i
--- expected HTML
+++ actual HTML
@@ -1,11 +1,3 @@
 <ul>
-<li>a</li>
-<li>b</li>
-<li>c</li>
-<li>d</li>
-<li>e</li>
-<li>f</li>
-<li>g</li>
-<li>h</li>
-<li>i</li>
+<li>a - b  - c   - d    - e   - f  - g - h- i</li>
 </ul>

Example 274 (lines 5072-5090) Lists

1. a

  2. b

    3. c
--- expected HTML
+++ actual HTML
@@ -1,11 +1,3 @@
 <ol>
-<li>
-<p>a</p>
-</li>
-<li>
-<p>b</p>
-</li>
-<li>
-<p>c</p>
-</li>
+<li>a  2. b    3. c</li>
 </ol>

Example 275 (lines 5096-5113) Lists

- a
- b

- c
--- expected HTML
+++ actual HTML
@@ -1,11 +1,3 @@
 <ul>
-<li>
-<p>a</p>
-</li>
-<li>
-<p>b</p>
-</li>
-<li>
-<p>c</p>
-</li>
+<li>a- b- c</li>
 </ul>

Example 276 (lines 5118-5133) Lists

* a
*

* c
--- expected HTML
+++ actual HTML
@@ -1,9 +1,3 @@
 <ul>
-<li>
-<p>a</p>
-</li>
-<li></li>
-<li>
-<p>c</p>
-</li>
+<li>a** c</li>
 </ul>

Example 277 (lines 5140-5159) Lists

- a
- b

  c
- d
--- expected HTML
+++ actual HTML
@@ -1,12 +1,3 @@
 <ul>
-<li>
-<p>a</p>
-</li>
-<li>
-<p>b</p>
-<p>c</p>
-</li>
-<li>
-<p>d</p>
-</li>
+<li>a- b  c- d</li>
 </ul>

Example 278 (lines 5162-5180) Lists

- a
- b

  [ref]: /url
- d
--- expected HTML
+++ actual HTML
@@ -1,11 +1,3 @@
 <ul>
-<li>
-<p>a</p>
-</li>
-<li>
-<p>b</p>
-</li>
-<li>
-<p>d</p>
-</li>
+<li>a- b  [ref]: /url- d</li>
 </ul>

Example 279 (lines 5185-5204) Lists

- a
- ```
  b


  ```
- c
--- expected HTML
+++ actual HTML
@@ -1,10 +1,3 @@
 <ul>
-<li>a</li>
-<li>
-<pre><code>b
-
-
-</code></pre>
-</li>
-<li>c</li>
+<li>a- <code>b</code>- c</li>
 </ul>

Example 280 (lines 5211-5229) Lists

- a
  - b

    c
- d
--- expected HTML
+++ actual HTML
@@ -1,11 +1,3 @@
 <ul>
-<li>a
-<ul>
-<li>
-<p>b</p>
-<p>c</p>
-</li>
+<li>a  - b    c- d</li>
 </ul>
-</li>
-<li>d</li>
-</ul>

Example 281 (lines 5235-5249) Lists

* a
  > b
  >
* c
--- expected HTML
+++ actual HTML
@@ -1,8 +1,3 @@
 <ul>
-<li>a
-<blockquote>
-<p>b</p>
-</blockquote>
-</li>
-<li>c</li>
+<li>a  &gt; b  &gt;* c</li>
 </ul>

Example 282 (lines 5255-5273) Lists

- a
  > b
  ```
  c
  ```
- d
--- expected HTML
+++ actual HTML
@@ -1,10 +1,3 @@
 <ul>
-<li>a
-<blockquote>
-<p>b</p>
-</blockquote>
-<pre><code>c
-</code></pre>
-</li>
-<li>d</li>
+<li>a  &gt; b  <code>c</code>- d</li>
 </ul>

Example 284 (lines 5287-5298) Lists

- a
  - b
--- expected HTML
+++ actual HTML
@@ -1,7 +1,3 @@
 <ul>
-<li>a
-<ul>
-<li>b</li>
+<li>a  - b</li>
 </ul>
-</li>
-</ul>

Example 285 (lines 5304-5318) Lists

1. ```
   foo
   ```

   bar
--- expected HTML
+++ actual HTML
@@ -1,7 +1,3 @@
 <ol>
-<li>
-<pre><code>foo
-</code></pre>
-<p>bar</p>
-</li>
+<li><code>foo</code>   bar</li>
 </ol>

Example 286 (lines 5323-5338) Lists

* foo
  * bar

  baz
--- expected HTML
+++ actual HTML
@@ -1,9 +1,3 @@
 <ul>
-<li>
-<p>foo</p>
-<ul>
-<li>bar</li>
+<li>foo  * bar  baz</li>
 </ul>
-<p>baz</p>
-</li>
-</ul>

Example 287 (lines 5341-5366) Lists

- a
  - b
  - c

- d
  - e
  - f
--- expected HTML
+++ actual HTML
@@ -1,16 +1,3 @@
 <ul>
-<li>
-<p>a</p>
-<ul>
-<li>b</li>
-<li>c</li>
+<li>a  - b  - c- d  - e  - f</li>
 </ul>
-</li>
-<li>
-<p>d</p>
-<ul>
-<li>e</li>
-<li>f</li>
-</ul>
-</li>
-</ul>

Example 291 (lines 5409-5427) Backslash escapes

\*not emphasized*
\<br/> not a tag
\[not a link](/foo)
\`not code`
1\. not a list
\* not a list
\# not a heading
\[foo]: /url "not a reference"
--- expected HTML
+++ actual HTML
@@ -1,8 +1 @@
-<p>*not emphasized*
-&lt;br/&gt; not a tag
-[not a link](/foo)
-`not code`
-1. not a list
-* not a list
-# not a heading
-[foo]: /url &quot;not a reference&quot;</p>
+<p>*not emphasized*&lt;br/&gt; not a tag[not a link](/foo)`not code`1. not a list* not a list# not a heading[foo]: /url &quot;not a reference&quot;</p>

Example 293 (lines 5441-5447) Backslash escapes

foo\
bar
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>foo<br />
-bar</p>
+<p>foo\bar</p>

Example 296 (lines 5468-5475) Backslash escapes

~~~
\[\]
~~~
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<pre><code>\[\]
-</code></pre>
+<p>~~~[]~~~</p>

Example 300 (lines 5502-5508) Backslash escapes

[foo]

[foo]: /bar\* "ti\*tle"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/bar*" title="ti*tle">foo</a></p>
+<p>[foo][foo]: /bar* &quot;ti*tle&quot;</p>

Example 301 (lines 5511-5518) Backslash escapes

``` foo\+bar
foo
```
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<pre><code class="language-foo+bar">foo
-</code></pre>
+<p><code>foo\+barfoo</code></p>

Example 302 (lines 5538-5546) Entity and numeric character references

&nbsp; &amp; &copy; &AElig; &Dcaron;
&frac34; &HilbertSpace; &DifferentialD;
&ClockwiseContourIntegral; &ngE;
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<p>  &amp; © Æ Ď
-¾ ℋ ⅆ
-∲ ≧̸</p>
+<p>  &amp; © Æ Ď¾ ℋ ⅆ∲ ≧̸</p>

Example 305 (lines 5579-5585) Entity and numeric character references

&nbsp &x; &#; &#x;
&ThisIsNotDefined; &hi?;
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>&amp;nbsp &amp;x; &amp;#; &amp;#x;
-&amp;ThisIsNotDefined; &amp;hi?;</p>
+<p>&amp;nbsp &amp;x; &amp;#; &amp;#x;&amp;ThisIsNotDefined; &amp;hi?;</p>

Example 310 (lines 5627-5633) Entity and numeric character references

[foo]

[foo]: /f&ouml;&ouml; "f&ouml;&ouml;"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p>
+<p>[foo][foo]: /föö &quot;föö&quot;</p>

Example 311 (lines 5636-5643) Entity and numeric character references

``` f&ouml;&ouml;
foo
```
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<pre><code class="language-föö">foo
-</code></pre>
+<p><code>f&amp;ouml;&amp;ouml;foo</code></p>

Example 347 (lines 6211-6217) Emphasis and strong emphasis

*foo bar
*
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>*foo bar
-*</p>
+<p><em>foo bar</em></p>

Example 364 (lines 6375-6381) Emphasis and strong emphasis

__
foo bar__
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>__
-foo bar__</p>
+<p><strong>foo bar</strong></p>

Example 374 (lines 6471-6477) Emphasis and strong emphasis

**Gomphocarpus (*Gomphocarpus physocarpus*, syn.
*Asclepias physocarpa*)**
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p><strong>Gomphocarpus (<em>Gomphocarpus physocarpus</em>, syn.
-<em>Asclepias physocarpa</em>)</strong></p>
+<p><strong>Gomphocarpus (<em>Gomphocarpus physocarpus</em>, syn.<em>Asclepias physocarpa</em>)</strong></p>

Example 385 (lines 6574-6580) Emphasis and strong emphasis

*foo
bar*
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p><em>foo
-bar</em></p>
+<p><em>foobar</em></p>

Example 400 (lines 6711-6717) Emphasis and strong emphasis

**foo
bar**
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p><strong>foo
-bar</strong></p>
+<p><strong>foobar</strong></p>

Example 409 (lines 6781-6787) Emphasis and strong emphasis

**foo *bar **baz**
bim* bop**
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p><strong>foo <em>bar <strong>baz</strong>
-bim</em> bop</strong></p>
+<p><strong>foo <em>bar <strong>baz</strong>bim</em> bop</strong></p>

Example 465 (lines 7290-7296) Links

[link](foo
bar)
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>[link](foo
-bar)</p>
+<p><a href="foobar">link</a></p>

Example 466 (lines 7299-7305) Links

[link](<foo
bar>)
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>[link](<foo
-bar>)</p>
+<p><a href="foobar">link</a></p>

Example 472 (lines 7353-7363) Links

[link](#fragment)

[link](http://example.com#fragment)

[link](http://example.com?foo=3#frag)
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<p><a href="#fragment">link</a></p>
-<p><a href="http://example.com#fragment">link</a></p>
-<p><a href="http://example.com?foo=3#frag">link</a></p>
+<p><a href="#fragment">link</a><a href="http://example.com#fragment">link</a><a href="http://example.com?foo=3#frag">link</a></p>

Example 476 (lines 7405-7413) Links

[link](/url "title")
[link](/url 'title')
[link](/url (title))
--- expected HTML
+++ actual HTML
@@ -1,3 +1 @@
-<p><a href="/url" title="title">link</a>
-<a href="/url" title="title">link</a>
-<a href="/url" title="title">link</a></p>
+<p><a href="/url" title="title">link</a><a href="/url" title="title">link</a><a href="/url" title="title">link</a></p>

Example 498 (lines 7641-7647) Links

[foo][bar]

[bar]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url" title="title">foo</a></p>
+<p>[foo][bar][bar]: /url &quot;title&quot;</p>

Example 499 (lines 7656-7662) Links

[link [foo [bar]]][ref]

[ref]: /uri
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/uri">link [foo [bar]]</a></p>
+<p>[link [foo [bar]]][ref][ref]: /uri</p>

Example 500 (lines 7665-7671) Links

[link \[bar][ref]

[ref]: /uri
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/uri">link [bar</a></p>
+<p>[link [bar][ref][ref]: /uri</p>

Example 501 (lines 7676-7682) Links

[link *foo **bar** `#`*][ref]

[ref]: /uri
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p>
+<p>[link <em>foo <strong>bar</strong> <code>#</code></em>][ref][ref]: /uri</p>

Example 502 (lines 7685-7691) Links

[![moon](moon.jpg)][ref]

[ref]: /uri
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p>
+<p>[<img src="moon.jpg" alt="moon" />][ref][ref]: /uri</p>

Example 503 (lines 7696-7702) Links

[foo [bar](/uri)][ref]

[ref]: /uri
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>[foo <a href="/uri">bar</a>]<a href="/uri">ref</a></p>
+<p>[foo <a href="/uri">bar</a>][ref][ref]: /uri</p>

Example 504 (lines 7705-7711) Links

[foo *bar [baz][ref]*][ref]

[ref]: /uri
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>[foo <em>bar <a href="/uri">baz</a></em>]<a href="/uri">ref</a></p>
+<p>[foo <em>bar [baz][ref]</em>][ref][ref]: /uri</p>

Example 505 (lines 7720-7726) Links

*[foo*][ref]

[ref]: /uri
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>*<a href="/uri">foo*</a></p>
+<p><em>[foo</em>][ref][ref]: /uri</p>

Example 506 (lines 7729-7735) Links

[foo *bar][ref]

[ref]: /uri
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/uri">foo *bar</a></p>
+<p>[foo *bar][ref][ref]: /uri</p>

Example 507 (lines 7741-7747) Links

[foo <bar attr="][ref]">

[ref]: /uri
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>[foo <bar attr="][ref]"></p>
+<p>[foo <bar attr="][ref]">[ref]: /uri</p>

Example 508 (lines 7750-7756) Links

[foo`][ref]`

[ref]: /uri
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>[foo<code>][ref]</code></p>
+<p>[foo<code>][ref]</code>[ref]: /uri</p>

Example 509 (lines 7759-7765) Links

[foo<http://example.com/?search=][ref]>

[ref]: /uri
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>[foo<a href="http://example.com/?search=%5D%5Bref%5D">http://example.com/?search=][ref]</a></p>
+<p>[foo<a href="http://example.com/?search=%5D%5Bref%5D">http://example.com/?search=][ref]</a>[ref]: /uri</p>

Example 510 (lines 7770-7776) Links

[foo][BaR]

[bar]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url" title="title">foo</a></p>
+<p>[foo][BaR][bar]: /url &quot;title&quot;</p>

Example 511 (lines 7781-7787) Links

[Толпой][Толпой] is a Russian word.

[ТОЛПОЙ]: /url
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url">Толпой</a> is a Russian word.</p>
+<p>[Толпой][Толпой] is a Russian word.[ТОЛПОЙ]: /url</p>

Example 512 (lines 7793-7800) Links

[Foo
  bar]: /url

[Baz][Foo bar]
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url">Baz</a></p>
+<p>[Foo  bar]: /url[Baz][Foo bar]</p>

Example 513 (lines 7806-7812) Links

[foo] [bar]

[bar]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>[foo] <a href="/url" title="title">bar</a></p>
+<p>[foo] [bar][bar]: /url &quot;title&quot;</p>

Example 514 (lines 7815-7823) Links

[foo]
[bar]

[bar]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>[foo]
-<a href="/url" title="title">bar</a></p>
+<p>[foo][bar][bar]: /url &quot;title&quot;</p>

Example 515 (lines 7856-7864) Links

[foo]: /url1

[foo]: /url2

[bar][foo]
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url1">bar</a></p>
+<p>[foo]: /url1[foo]: /url2[bar][foo]</p>

Example 516 (lines 7871-7877) Links

[bar][foo\!]

[foo!]: /url
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>[bar][foo!]</p>
+<p>[bar][foo!][foo!]: /url</p>

Example 517 (lines 7883-7890) Links

[foo][ref[]

[ref[]: /uri
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>[foo][ref[]</p>
-<p>[ref[]: /uri</p>
+<p>[foo][ref[][ref[]: /uri</p>

Example 518 (lines 7893-7900) Links

[foo][ref[bar]]

[ref[bar]]: /uri
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>[foo][ref[bar]]</p>
-<p>[ref[bar]]: /uri</p>
+<p>[foo][ref[bar]][ref[bar]]: /uri</p>

Example 519 (lines 7903-7910) Links

[[[foo]]]

[[[foo]]]: /url
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>[[[foo]]]</p>
-<p>[[[foo]]]: /url</p>
+<p>[[[foo]]][[[foo]]]: /url</p>

Example 520 (lines 7913-7919) Links

[foo][ref\[]

[ref\[]: /uri
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/uri">foo</a></p>
+<p>[foo][ref[][ref[]: /uri</p>

Example 521 (lines 7924-7930) Links

[bar\\]: /uri

[bar\\]
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/uri">bar\</a></p>
+

Example 522 (lines 7935-7942) Links

[]

[]: /uri
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>[]</p>
-<p>[]: /uri</p>
+<p>[][]: /uri</p>

Example 523 (lines 7945-7956) Links

[
 ]

[
 ]: /uri
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<p>[
-]</p>
-<p>[
-]: /uri</p>
+<p>[ ][ ]: /uri</p>

Example 524 (lines 7968-7974) Links

[foo][]

[foo]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url" title="title">foo</a></p>
+<p>[foo][][foo]: /url &quot;title&quot;</p>

Example 525 (lines 7977-7983) Links

[*foo* bar][]

[*foo* bar]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url" title="title"><em>foo</em> bar</a></p>
+<p>[<em>foo</em> bar][][<em>foo</em> bar]: /url &quot;title&quot;</p>

Example 526 (lines 7988-7994) Links

[Foo][]

[foo]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url" title="title">Foo</a></p>
+<p>[Foo][][foo]: /url &quot;title&quot;</p>

Example 527 (lines 8001-8009) Links

[foo] 
[]

[foo]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p><a href="/url" title="title">foo</a>
-[]</p>
+<p>[foo] [][foo]: /url &quot;title&quot;</p>

Example 528 (lines 8021-8027) Links

[foo]

[foo]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url" title="title">foo</a></p>
+<p>[foo][foo]: /url &quot;title&quot;</p>

Example 529 (lines 8030-8036) Links

[*foo* bar]

[*foo* bar]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url" title="title"><em>foo</em> bar</a></p>
+<p>[<em>foo</em> bar][<em>foo</em> bar]: /url &quot;title&quot;</p>

Example 530 (lines 8039-8045) Links

[[*foo* bar]]

[*foo* bar]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>[<a href="/url" title="title"><em>foo</em> bar</a>]</p>
+<p>[[<em>foo</em> bar]][<em>foo</em> bar]: /url &quot;title&quot;</p>

Example 531 (lines 8048-8054) Links

[[bar [foo]

[foo]: /url
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>[[bar <a href="/url">foo</a></p>
+<p>[[bar [foo][foo]: /url</p>

Example 532 (lines 8059-8065) Links

[Foo]

[foo]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url" title="title">Foo</a></p>
+<p>[Foo][foo]: /url &quot;title&quot;</p>

Example 533 (lines 8070-8076) Links

[foo] bar

[foo]: /url
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url">foo</a> bar</p>
+<p>[foo] bar[foo]: /url</p>

Example 534 (lines 8082-8088) Links

\[foo]

[foo]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>[foo]</p>
+<p>[foo][foo]: /url &quot;title&quot;</p>

Example 535 (lines 8094-8100) Links

[foo*]: /url

*[foo*]
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>*<a href="/url">foo*</a></p>
+

Example 536 (lines 8106-8113) Links

[foo][bar]

[foo]: /url1
[bar]: /url2
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url2">foo</a></p>
+<p>[foo][bar][foo]: /url1[bar]: /url2</p>

Example 537 (lines 8115-8121) Links

[foo][]

[foo]: /url1
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url1">foo</a></p>
+<p>[foo][][foo]: /url1</p>

Example 538 (lines 8125-8131) Links

[foo]()

[foo]: /url1
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="">foo</a></p>
+<p><a href="">foo</a>[foo]: /url1</p>

Example 539 (lines 8133-8139) Links

[foo](not a link)

[foo]: /url1
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url1">foo</a>(not a link)</p>
+<p>[foo](not a link)[foo]: /url1</p>

Example 540 (lines 8144-8150) Links

[foo][bar][baz]

[baz]: /url
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>[foo]<a href="/url">bar</a></p>
+<p>[foo][bar][baz][baz]: /url</p>

Example 541 (lines 8156-8163) Links

[foo][bar][baz]

[baz]: /url1
[bar]: /url2
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><a href="/url2">foo</a><a href="/url1">baz</a></p>
+<p>[foo][bar][baz][baz]: /url1[bar]: /url2</p>

Example 542 (lines 8169-8176) Links

[foo][bar][baz]

[baz]: /url1
[foo]: /url2
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>[foo]<a href="/url1">bar</a></p>
+<p>[foo][bar][baz][baz]: /url1[foo]: /url2</p>

Example 544 (lines 8199-8205) Images

![foo *bar*]

[foo *bar*]: train.jpg "train & tracks"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p>
+<p>![foo <em>bar</em>][foo <em>bar</em>]: train.jpg &quot;train &amp; tracks&quot;</p>

Example 547 (lines 8229-8235) Images

![foo *bar*][]

[foo *bar*]: train.jpg "train & tracks"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p>
+<p>![foo <em>bar</em>][][foo <em>bar</em>]: train.jpg &quot;train &amp; tracks&quot;</p>

Example 548 (lines 8238-8244) Images

![foo *bar*][foobar]

[FOOBAR]: train.jpg "train & tracks"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p>
+<p>![foo <em>bar</em>][foobar][FOOBAR]: train.jpg &quot;train &amp; tracks&quot;</p>

Example 553 (lines 8277-8283) Images

![foo][bar]

[bar]: /url
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><img src="/url" alt="foo" /></p>
+<p>![foo][bar][bar]: /url</p>

Example 554 (lines 8286-8292) Images

![foo][bar]

[BAR]: /url
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><img src="/url" alt="foo" /></p>
+<p>![foo][bar][BAR]: /url</p>

Example 555 (lines 8297-8303) Images

![foo][]

[foo]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><img src="/url" alt="foo" title="title" /></p>
+<p>![foo][][foo]: /url &quot;title&quot;</p>

Example 556 (lines 8306-8312) Images

![*foo* bar][]

[*foo* bar]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><img src="/url" alt="foo bar" title="title" /></p>
+<p>![<em>foo</em> bar][][<em>foo</em> bar]: /url &quot;title&quot;</p>

Example 557 (lines 8317-8323) Images

![Foo][]

[foo]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><img src="/url" alt="Foo" title="title" /></p>
+<p>![Foo][][foo]: /url &quot;title&quot;</p>

Example 558 (lines 8329-8337) Images

![foo] 
[]

[foo]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p><img src="/url" alt="foo" title="title" />
-[]</p>
+<p>![foo] [][foo]: /url &quot;title&quot;</p>

Example 559 (lines 8342-8348) Images

![foo]

[foo]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><img src="/url" alt="foo" title="title" /></p>
+<p>![foo][foo]: /url &quot;title&quot;</p>

Example 560 (lines 8351-8357) Images

![*foo* bar]

[*foo* bar]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><img src="/url" alt="foo bar" title="title" /></p>
+<p>![<em>foo</em> bar][<em>foo</em> bar]: /url &quot;title&quot;</p>

Example 561 (lines 8362-8369) Images

![[foo]]

[[foo]]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>![[foo]]</p>
-<p>[[foo]]: /url &quot;title&quot;</p>
+<p>![[foo]][[foo]]: /url &quot;title&quot;</p>

Example 562 (lines 8374-8380) Images

![Foo]

[foo]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><img src="/url" alt="Foo" title="title" /></p>
+<p>![Foo][foo]: /url &quot;title&quot;</p>

Example 563 (lines 8386-8392) Images

!\[foo]

[foo]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>![foo]</p>
+<p>![foo][foo]: /url &quot;title&quot;</p>

Example 564 (lines 8398-8404) Images

\![foo]

[foo]: /url "title"
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p>!<a href="/url" title="title">foo</a></p>
+<p>![foo][foo]: /url &quot;title&quot;</p>

Example 586 (lines 8687-8693) Raw HTML

<a  /><b2
data="foo" >
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p><a  /><b2
-data="foo" ></p>
+<p><a  />&lt;b2data=&quot;foo&quot; &gt;</p>

Example 587 (lines 8698-8704) Raw HTML

<a foo="bar" bam = 'baz <em>"</em>'
_boolean zoop:33=zoop:33 />
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p><a foo="bar" bam = 'baz <em>"</em>'
-_boolean zoop:33=zoop:33 /></p>
+<p>&lt;a foo=&quot;bar&quot; bam = 'baz <em>&quot;</em>'_boolean zoop:33=zoop:33 /&gt;</p>

Example 592 (lines 8745-8755) Raw HTML

< a><
foo><bar/ >
<foo bar=baz
bim!bop />
--- expected HTML
+++ actual HTML
@@ -1,4 +1 @@
-<p>&lt; a&gt;&lt;
-foo&gt;&lt;bar/ &gt;
-&lt;foo bar=baz
-bim!bop /&gt;</p>
+<p>&lt; a&gt;<foo>&lt;bar/ &gt;<foo bar=bazbim!bop /></p>

Example 596 (lines 8787-8793) Raw HTML

foo <!-- this is a
comment - with hyphen -->
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>foo <!-- this is a
-comment - with hyphen --></p>
+<p>foo <!-- this is acomment - with hyphen --></p>

Example 598 (lines 8805-8812) Raw HTML

foo <!--> foo -->

foo <!-- foo--->
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>foo &lt;!--&gt; foo --&gt;</p>
-<p>foo &lt;!-- foo---&gt;</p>
+<p>foo &lt;!--&gt; foo --&gt;foo &lt;!-- foo---&gt;</p>

Example 605 (lines 8875-8881) Hard line breaks

foo  
baz
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>foo<br />
-baz</p>
+<p>foo  baz</p>

Example 606 (lines 8887-8893) Hard line breaks

foo\
baz
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>foo<br />
-baz</p>
+<p>foo\baz</p>

Example 607 (lines 8898-8904) Hard line breaks

foo       
baz
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>foo<br />
-baz</p>
+<p>foo       baz</p>

Example 608 (lines 8909-8915) Hard line breaks

foo  
     bar
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>foo<br />
-bar</p>
+<p>foo       bar</p>

Example 609 (lines 8918-8924) Hard line breaks

foo\
     bar
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>foo<br />
-bar</p>
+<p>foo\     bar</p>

Example 610 (lines 8930-8936) Hard line breaks

*foo  
bar*
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p><em>foo<br />
-bar</em></p>
+<p><em>foo  bar</em></p>

Example 611 (lines 8939-8945) Hard line breaks

*foo\
bar*
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p><em>foo<br />
-bar</em></p>
+<p><em>foo\bar</em></p>

Example 613 (lines 8958-8963) Hard line breaks

`code\
span`
--- expected HTML
+++ actual HTML
@@ -1 +1 @@
-<p><code>code\ span</code></p>
+<p><code>code\span</code></p>

Example 614 (lines 8968-8974) Hard line breaks

<a href="foo  
bar">
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p><a href="foo  
-bar"></p>
+<a href="foo  bar">

Example 615 (lines 8977-8983) Hard line breaks

<a href="foo\
bar">
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p><a href="foo\
-bar"></p>
+<a href="foo\bar">

Example 620 (lines 9026-9032) Soft line breaks

foo
baz
--- expected HTML
+++ actual HTML
@@ -1,2 +1 @@
-<p>foo
-baz</p>
+<p>foobaz</p>

301 passed, 323 failed, 0 errored, 0 skipped

Revisit `Markd::Renderer` implementation

Per the README:

If you want to use a custom renderer, it can!

class CustomRenderer < Markd::Renderer

  def strong(node, entering)
  end

  # more methods following in render.
end

options = Markd::Options.new(time: true)
document = Markd::Parser.parse(markdown, options)
renderer = CustomRenderer.new(options)

html = renderer.render(document)

IMO I don't think this is the best approach, Markd::Renderer is centered around the HTML renderer specifically, so an unsuspecting user may implement a custom renderer that only overrides #strong (for example), expecting the rest of the markdown to be rendered as text—except it's rendered HTML now! It's also not clear what methods can be overridden unless you look into the source code (partially related to #55). I think it would be better if Markd::Renderer was implemented as an abstract class with abstract methods, like an interface:

module Markd
  abstract class Renderer
    abstract def heading(node : Node, entering : Bool) : Nil
    abstract def list(node : Node, entering : Bool) : Nil
    abstract def item(node : Node, entering : Bool) : Nil
    abstract def block_quote(node : Node, entering : Bool) : Nil
    # ...
  end
end

This way it's clear what methods you can/have to implement. If users just want to override one or more methods like in the README example, they still can do so by extending Markd::HTMLRenderer. WDYT?

Revisit `Markd::Options` class

I think that there could be some changes/improvements to the current Options class:

  • Removing unimplemented options: given that they're not used, there's no actual reason to have them in the class – having a TODO comment or similar in place would be better for whomever wants to implement them
  • Removing time: I understand the purpose but this is really something that users could implement themselves if they wanted that information, and it's relatively easy to do
  • Replace safe: I like this option, but it is quite restricting – if you wanted to allow table HTML and nothing else, there would be no way to do that without performing string manipulation post-rendering. I think it would be better to change this into something like sanitize which gives you options on what HTML elements you want to allow, there is a sanitize shard that would be great for this
  • Rename prettyprint: (this one isn't important, but pretty_print makes so much more sense here lol)

WDYT?

Lexer Blocks & Inlines

CommonMark spec: Block & Inlines

Container Blocks:

  • Block quote
  • List Items
  • List

Leaf Blocks:

  • Thematic breaks
  • ATX headings
  • Setext headings
  • Indented code blocks
  • Fenced code blocks
  • HTML blocks
  • Link reference definitions
  • Paragraphs
  • Blank lines

Inlines:

  • Backslash escapes
  • Entity and numeric character references
  • Code spans
  • Emphasis and strong emphasis
  • Links
  • Images
  • Autolinks
  • Raw HTML
  • Hard line breaks
  • Soft line breaks
  • extual content

It crashes when trying to parse an empty string.

Minimal example of this bug:

require "markd"

# empty string as input
input = ""

options = Markd::Options.new()
puts Markd.to_html(input, options)

When run, this will produce:

Index out of bounds (IndexError)
  from /usr/local/Cellar/crystal-lang/0.24.1_2/src/string.cr:831:16 in '[]'
  from src/markd/parsers/block.cr:75:26 in 'prepare_input'
  from src/markd/parsers/block.cr:57:9 in 'parse'
  from src/markd/parsers/block.cr:6:7 in 'parse'
  from src/markd/parser.cr:4:7 in 'parse'
  from src/markd.cr:12:5 in 'to_html'
  from src/bin/test.cr:6:1 in '__crystal_main'
  from /usr/local/Cellar/crystal-lang/0.24.1_2/src/crystal/main.cr:11:3 in '_crystal_main'
  from /usr/local/Cellar/crystal-lang/0.24.1_2/src/crystal/main.cr:112:5 in 'main_user_code'
  from /usr/local/Cellar/crystal-lang/0.24.1_2/src/crystal/main.cr:101:7 in 'main'
  from /usr/local/Cellar/crystal-lang/0.24.1_2/src/crystal/main.cr:135:3 in 'main'

Pass the commonmark specs

Run [spec/spec.txt] examples

  • Tabs (11)
  • Precedence (1)
  • Thematic breaks (19)
  • ATX headings (18)
  • Setext headings (26)
  • Indented code blocks (12)
  • Fenced code blocks (27)
  • HTML blocks (42)
  • Link reference definitions (23)
  • Paragraphs (8)
  • Blank lines (1)
  • Block quotes (25)
  • List items (48)
  • Lists (24)
  • Inlines (1)
  • Backslash escapes (13)
  • Entity and numeric character references (12)
  • Code spans (16)
  • Emphasis and strong emphasis (128)
  • Links (84)
  • Images (22)
  • Autolinks (19)
  • Raw HTML (21)
  • Hard line breaks (15)
  • Soft line breaks (2)
  • Textual content (3)

Total 26 describes and 621 examples

Reason why Markd::Options is a struct ?

Hello,

I'm working on a home-made patch, using Markd as a code base.

I'm making my own classes inheriting from Markd to be able to get most of the next update without too much effort (If you have a better idea I'd like to know :D) so I can add my custom behavior over the default markdown.
I want it mostly to add internal links, tagging, and minor CSS features I will add in the futur.

But I have this thing with Options wich is a structure... so A struct cannot inherit from a non-abstract struct. Which means I must fork manually to change it to a class. Any reason you put it this way ? Want to change maybe ? ;) ;)

Evening !

It fails karlcow/markdown-testsuite

It fails karlcow/markdown-testsuite:

markd |FFFFFFFFF....FFF.FFFFFFFFFFF....F.FF.F...............FF.....FF...FFFFFFFFFFFFFF.FFFF..........FFFFFFFFF|   1.09s  103   58  56%
Show detailed output

2-paragraphs-hard-return-spaces | #1 | markd

u'This is a first paragraph,\non multiple lines.\n     \nThis is a second paragraph.\nThere are spaces in between the two.'

Normalized actual / expected:

u'<p>This is a first paragraph,on multiple lines. This is a second paragraph.There are spaces in between the two.</p>'
u'<p>This is a first paragraph, on multiple lines.</p><p>This is a second paragraph. There are spaces in between the two.</p>'

Raw actual / expected:

u'<p>This is a first paragraph,on multiple lines.     This is a second paragraph.There are spaces in between the two.</p>\n'
u'<p>This is a first paragraph,\non multiple lines.</p>\n\n<p>This is a second paragraph.\nThere are spaces in between the two.</p>'

2-paragraphs-hard-return | #2 | markd

u'This is a first paragraph,\non multiple lines.\n\nThis is a second paragraph\nwhich has multiple lines too.'

Normalized actual / expected:

u'<p>This is a first paragraph,on multiple lines.This is a second paragraphwhich has multiple lines too.</p>'
u'<p>This is a first paragraph, on multiple lines.</p><p>This is a second paragraph which has multiple lines too.</p>'

Raw actual / expected:

u'<p>This is a first paragraph,on multiple lines.This is a second paragraphwhich has multiple lines too.</p>\n'
u'<p>This is a first paragraph,\non multiple lines.</p>\n\n<p>This is a second paragraph\nwhich has multiple lines too.</p>'

2-paragraphs-line-returns | #3 | markd

u'A first paragraph.\n\n\n\nA second paragraph after 3 CR (carriage return).'

Normalized actual / expected:

u'<p>A first paragraph.A second paragraph after 3 CR (carriage return).</p>'
u'<p>A first paragraph.</p><p>A second paragraph after 3 CR (carriage return).</p>'

Raw actual / expected:

u'<p>A first paragraph.A second paragraph after 3 CR (carriage return).</p>\n'
u'<p>A first paragraph.</p>\n\n<p>A second paragraph after 3 CR (carriage return).</p>'

2-paragraphs-line-spaces | #4 | markd

u'This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.\n     \nA few spaces and a new long long long long long long long long long long long long long long long long paragraph on 1 line.'

Normalized actual / expected:

u'<p>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line. A few spaces and a new long long long long long long long long long long long long long long long long paragraph on 1 line.</p>'
u'<p>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.</p><p>A few spaces and a new long long long long long long long long long long long long long long long long paragraph on 1 line.</p>'

Raw actual / expected:

u'<p>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.     A few spaces and a new long long long long long long long long long long long long long long long long paragraph on 1 line.</p>\n'
u'<p>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.</p>\n\n<p>A few spaces and a new long long long long long long long long long long long long long long long long paragraph on 1 line.</p>'

2-paragraphs-line-tab | #5 | markd

u'This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.\n\t\n1 tab to separate them and a new long long long long long long long long long long long long long long long long paragraph on 1 line.'

Normalized actual / expected:

u'<p>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line. 1 tab to separate them and a new long long long long long long long long long long long long long long long long paragraph on 1 line.</p>'
u'<p>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.</p><p>1 tab to separate them and a new long long long long long long long long long long long long long long long long paragraph on 1 line.</p>'

Raw actual / expected:

u'<p>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.\t1 tab to separate them and a new long long long long long long long long long long long long long long long long paragraph on 1 line.</p>\n'
u'<p>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.</p>\n\n<p>1 tab to separate them and a new long long long long long long long long long long long long long long long long paragraph on 1 line.</p>'

2-paragraphs-line | #6 | markd

u'This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.\n\nA new long long long long long long long long long long long long long long long long paragraph on 1 line.'

Normalized actual / expected:

u'<p>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.A new long long long long long long long long long long long long long long long long paragraph on 1 line.</p>'
u'<p>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.</p><p>A new long long long long long long long long long long long long long long long long paragraph on 1 line.</p>'

Raw actual / expected:

u'<p>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.A new long long long long long long long long long long long long long long long long paragraph on 1 line.</p>\n'
u'<p>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line.</p>\n\n<p>A new long long long long long long long long long long long long long long long long paragraph on 1 line.</p>'

EOL-CR+LF | #7 | markd

u"These lines all end with end of line (EOL) sequences.\r\n\r\nSeriously, they really do.\r\n\r\nIf you don't believe me: HEX EDIT!\r\n\r\n"

Normalized actual / expected:

u"<p>These lines all end with end of line (EOL) sequences.Seriously, they really do.If you don't believe me: HEX EDIT!</p>"
u"<p>These lines all end with end of line (EOL) sequences.</p><p>Seriously, they really do.</p><p>If you don't believe me: HEX EDIT!</p>"

Raw actual / expected:

u"<p>These lines all end with end of line (EOL) sequences.Seriously, they really do.If you don't believe me: HEX EDIT!</p>\n"
u"<p>These lines all end with end of line (EOL) sequences.</p>\r\n\r\n<p>Seriously, they really do.</p>\r\n\r\n<p>If you don't believe me: HEX EDIT!</p>"

EOL-CR | #8 | markd

u"These lines all end with end of line (EOL) sequences.\r\rSeriously, they really do.\r\rIf you don't believe me: HEX EDIT!\r\r"

Normalized actual / expected:

u"<p>These lines all end with end of line (EOL) sequences. Seriously, they really do. If you don't believe me: HEX EDIT!</p>"
u"<p>These lines all end with end of line (EOL) sequences.</p><p>Seriously, they really do.</p><p>If you don't believe me: HEX EDIT!</p>"

Raw actual / expected:

u"<p>These lines all end with end of line (EOL) sequences.\n\nSeriously, they really do.\n\nIf you don't believe me: HEX EDIT!</p>\n"
u"<p>These lines all end with end of line (EOL) sequences.</p>\r\r<p>Seriously, they really do.</p>\r\r<p>If you don't believe me: HEX EDIT!</p>"

EOL-LF | #9 | markd

u"These lines all end with end of line (EOL) sequences.\n\nSeriously, they really do.\n\nIf you don't believe me: HEX EDIT!\n\n"

Normalized actual / expected:

u"<p>These lines all end with end of line (EOL) sequences.Seriously, they really do.If you don't believe me: HEX EDIT!</p>"
u"<p>These lines all end with end of line (EOL) sequences.</p><p>Seriously, they really do.</p><p>If you don't believe me: HEX EDIT!</p>"

Raw actual / expected:

u"<p>These lines all end with end of line (EOL) sequences.Seriously, they really do.If you don't believe me: HEX EDIT!</p>\n"
u"<p>These lines all end with end of line (EOL) sequences.</p>\n\n<p>Seriously, they really do.</p>\n\n<p>If you don't believe me: HEX EDIT!</p>"

backslash-escape | #14 | markd

u'\\\\   backslash\n\\`   backtick\n\\*   asterisk\n\\_   underscore\n\\{\\}  curly braces\n\\[\\]  square brackets\n\\(\\)  parentheses\n\\#   hash mark\n\\+   plus sign\n\\-   minus sign (hyphen)\n\\.   dot\n\\!   exclamation mark'

Normalized actual / expected:

u'<p>\\ backslash` backtick* asterisk_ underscore{} curly braces[] square brackets() parentheses# hash mark+ plus sign- minus sign (hyphen). dot! exclamation mark</p>'
u'<p>\\ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parentheses # hash mark + plus sign - minus sign (hyphen) . dot ! exclamation mark</p>'

Raw actual / expected:

u'<p>\\   backslash`   backtick*   asterisk_   underscore{}  curly braces[]  square brackets()  parentheses#   hash mark+   plus sign-   minus sign (hyphen).   dot!   exclamation mark</p>\n'
u'<p>\\   backslash\n`   backtick\n*   asterisk\n_   underscore\n{}  curly braces\n[]  square brackets\n()  parentheses\n#   hash mark\n+   plus sign\n-   minus sign (hyphen)\n.   dot\n!   exclamation mark</p>'

blockquote-added-markup | #15 | markd

u'> # heading level 1\n> \n> paragraph'

Normalized actual / expected:

u'<blockquote><h1>heading level 1>> paragraph</h1></blockquote>'
u'<blockquote><h1>heading level 1</h1><p>paragraph</p></blockquote>'

Raw actual / expected:

u'<blockquote>\n<h1>heading level 1&gt; &gt; paragraph</h1>\n</blockquote>\n'
u'<blockquote>\n<h1>heading level 1</h1>\n\n<p>paragraph</p>\n</blockquote>'

blockquote-line-2-paragraphs | #16 | markd

u'>A blockquote with a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line.\n\n>and a second very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line.'

Normalized actual / expected:

u'<blockquote><p>A blockquote with a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line.>and a second very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line.</p></blockquote>'
u'<blockquote><p>A blockquote with a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line.</p><p>and a second very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line.</p></blockquote>'

Raw actual / expected:

u'<blockquote>\n<p>A blockquote with a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line.&gt;and a second very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line.</p>\n</blockquote>\n'
u'<blockquote>\n<p>A blockquote with a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line.</p>\n\n<p>and a second very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line.</p>\n</blockquote>'

blockquote-multiline-1-space-begin | #18 | markd

u'> A blockquote\n> on multiple lines\n> like this.'

Normalized actual / expected:

u'<blockquote><p>A blockquote> on multiple lines> like this.</p></blockquote>'
u'<blockquote><p>A blockquote on multiple lines like this.</p></blockquote>'

Raw actual / expected:

u'<blockquote>\n<p>A blockquote&gt; on multiple lines&gt; like this.</p>\n</blockquote>\n'
u'<blockquote>\n<p>A blockquote\non multiple lines\nlike this.</p>\n</blockquote>'

blockquote-multiline-1-space-end | #19 | markd

u'>A blockquote \n>on multiple lines \n>like this. '

Normalized actual / expected:

u'<blockquote><p>A blockquote >on multiple lines >like this.</p></blockquote>'
u'<blockquote><p>A blockquote on multiple lines like this.</p></blockquote>'

Raw actual / expected:

u'<blockquote>\n<p>A blockquote &gt;on multiple lines &gt;like this.</p>\n</blockquote>\n'
u'<blockquote>\n<p>A blockquote \non multiple lines \nlike this. </p>\n</blockquote>'

blockquote-multiline-2-paragraphs | #20 | markd

u'>A blockquote\n>on multiple lines\n>like this.\n>\n>But it has\n>two paragraphs.'

Normalized actual / expected:

u'<blockquote><p>A blockquote>on multiple lines>like this.>>But it has>two paragraphs.</p></blockquote>'
u'<blockquote><p>A blockquote on multiple lines like this.</p><p>But it has two paragraphs.</p></blockquote>'

Raw actual / expected:

u'<blockquote>\n<p>A blockquote&gt;on multiple lines&gt;like this.&gt;&gt;But it has&gt;two paragraphs.</p>\n</blockquote>\n'
u'<blockquote>\n<p>A blockquote\non multiple lines\nlike this.</p>\n\n<p>But it has\ntwo paragraphs.</p>\n</blockquote>'

blockquote-multiline | #21 | markd

u'>A blockquote\n>on multiple lines\n>like this'

Normalized actual / expected:

u'<blockquote><p>A blockquote>on multiple lines>like this</p></blockquote>'
u'<blockquote><p>A blockquote on multiple lines like this</p></blockquote>'

Raw actual / expected:

u'<blockquote>\n<p>A blockquote&gt;on multiple lines&gt;like this</p>\n</blockquote>\n'
u'<blockquote>\n<p>A blockquote\non multiple lines\nlike this</p>\n</blockquote>'

blockquote-nested-multiplereturn-level1 | #22 | markd

u'> This is the first level of quoting.\n>\n> > This is nested blockquote.\n>\n> Back to the first level.\n'

Normalized actual / expected:

u'<blockquote><p>This is the first level of quoting.>>> This is nested blockquote.>> Back to the first level.</p></blockquote>'
u'<blockquote><p>This is the first level of quoting.</p><blockquote><p>This is nested blockquote.</p></blockquote><p>Back to the first level.</p></blockquote>'

Raw actual / expected:

u'<blockquote>\n<p>This is the first level of quoting.&gt;&gt; &gt; This is nested blockquote.&gt;&gt; Back to the first level.</p>\n</blockquote>\n'
u'<blockquote>\n<p>This is the first level of quoting.</p>\n\n<blockquote>\n<p>This is nested blockquote.</p>\n</blockquote>\n\n<p>Back to the first level.</p>\n</blockquote>'

blockquote-nested-multiplereturn | #23 | markd

u'> This is the first level of quoting.\n>\n> > This is nested blockquote.'

Normalized actual / expected:

u'<blockquote><p>This is the first level of quoting.>>> This is nested blockquote.</p></blockquote>'
u'<blockquote><p>This is the first level of quoting.</p><blockquote><p>This is nested blockquote.</p></blockquote></blockquote>'

Raw actual / expected:

u'<blockquote>\n<p>This is the first level of quoting.&gt;&gt; &gt; This is nested blockquote.</p>\n</blockquote>\n'
u'<blockquote>\n<p>This is the first level of quoting.</p>\n\n<blockquote>\n<p>This is nested blockquote.</p>\n</blockquote>\n</blockquote>'

blockquote-nested-return-level1 | #24 | markd

u'> This is the first level of quoting.\n> > This is nested blockquote.\n> Back to the first level.\n'

Normalized actual / expected:

u'<blockquote><p>This is the first level of quoting.>> This is nested blockquote.> Back to the first level.</p></blockquote>'
u'<blockquote><p>This is the first level of quoting.</p><blockquote><p>This is nested blockquote. Back to the first level.</p></blockquote></blockquote>'

Raw actual / expected:

u'<blockquote>\n<p>This is the first level of quoting.&gt; &gt; This is nested blockquote.&gt; Back to the first level.</p>\n</blockquote>\n'
u'<blockquote>\n<p>This is the first level of quoting.</p>\n\n<blockquote>\n<p>This is nested blockquote.\nBack to the first level.</p>\n</blockquote>\n</blockquote>'

blockquote-nested | #25 | markd

u'> This is the first level of quoting.\n> > This is nested blockquote.\n'

Normalized actual / expected:

u'<blockquote><p>This is the first level of quoting.>> This is nested blockquote.</p></blockquote>'
u'<blockquote><p>This is the first level of quoting.</p><blockquote><p>This is nested blockquote.</p></blockquote></blockquote>'

Raw actual / expected:

u'<blockquote>\n<p>This is the first level of quoting.&gt; &gt; This is nested blockquote.</p>\n</blockquote>\n'
u'<blockquote>\n<p>This is the first level of quoting.</p>\n\n<blockquote>\n<p>This is nested blockquote.</p>\n</blockquote>\n</blockquote>'

code-1-tab | #26 | markd

u'\t10 PRINT HELLO INFINITE\n\t20 GOTO 10'

Normalized actual / expected:

u'<pre><code>10 PRINT HELLO INFINITE\t20 GOTO 10\n</code></pre>'
u'<pre><code>10 PRINT HELLO INFINITE\n20 GOTO 10\n</code></pre>'

Raw actual / expected:

u'<pre><code>10 PRINT HELLO INFINITE\t20 GOTO 10\n</code></pre>\n'
u'<pre><code>10 PRINT HELLO INFINITE\n20 GOTO 10\n</code></pre>'

code-4-spaces-escaping | #27 | markd

u'    10 PRINT < > &\n    20 GOTO 10'

Normalized actual / expected:

u'<pre><code>10 PRINT < > &    20 GOTO 10\n</code></pre>'
u'<pre><code>10 PRINT < > &\n20 GOTO 10\n</code></pre>'

Raw actual / expected:

u'<pre><code>10 PRINT &lt; &gt; &amp;    20 GOTO 10\n</code></pre>\n'
u'<pre><code>10 PRINT &lt; &gt; &amp;\n20 GOTO 10\n</code></pre>'

code-4-spaces | #28 | markd

u'    10 PRINT HELLO INFINITE\n    20 GOTO 10'

Normalized actual / expected:

u'<pre><code>10 PRINT HELLO INFINITE    20 GOTO 10\n</code></pre>'
u'<pre><code>10 PRINT HELLO INFINITE\n20 GOTO 10\n</code></pre>'

Raw actual / expected:

u'<pre><code>10 PRINT HELLO INFINITE    20 GOTO 10\n</code></pre>\n'
u'<pre><code>10 PRINT HELLO INFINITE\n20 GOTO 10\n</code></pre>'

header-level1-equal-underlined | #33 | markd

u'This is an H1\n============='

Normalized actual / expected:

u'<p>This is an H1=============</p>'
u'<h1>This is an H1</h1>'

Raw actual / expected:

u'<p>This is an H1=============</p>\n'
u'<h1>This is an H1</h1>'

header-level1-hash-sign-trailing-1-space | #35 | markd

u' # This is an H1'

Normalized actual / expected:

u'<h1>This is an H1</h1>'
u'<p># This is an H1</p>'

Raw actual / expected:

u'<h1>This is an H1</h1>\n'
u'<p># This is an H1</p>'

header-level1-hash-sign-trailing-2-spaces | #36 | markd

u'# this is an h1 with two trailing spaces  \nA new paragraph.'

Normalized actual / expected:

u'<h1>this is an h1 with two trailing spaces A new paragraph.</h1>'
u'<h1>this is an h1 with two trailing spaces</h1><p>A new paragraph.</p>'

Raw actual / expected:

u'<h1>this is an h1 with two trailing spaces  A new paragraph.</h1>\n'
u'<h1>this is an h1 with two trailing spaces</h1>\n\n<p>A new paragraph.</p>'

header-level2-dash-underlined | #38 | markd

u'This is an H2\n-------------'

Normalized actual / expected:

u'<p>This is an H2-------------</p>'
u'<h2>This is an H2</h2>'

Raw actual / expected:

u'<p>This is an H2-------------</p>\n'
u'<h2>This is an H2</h2>'

img-idref-title | #54 | markd

u'![HTML5][h5]\n\n[h5]: http://www.w3.org/html/logo/img/mark-word-icon.png "HTML5 for everyone"'

Normalized actual / expected:

u'<p>![HTML5][h5][h5]: http://www.w3.org/html/logo/img/mark-word-icon.png "HTML5 for everyone"</p>'
u'<p><img alt="HTML5" src="http://www.w3.org/html/logo/img/mark-word-icon.png" title="HTML5 for everyone"></p>'

Raw actual / expected:

u'<p>![HTML5][h5][h5]: http://www.w3.org/html/logo/img/mark-word-icon.png &quot;HTML5 for everyone&quot;</p>\n'
u'<p><img src="http://www.w3.org/html/logo/img/mark-word-icon.png" alt="HTML5" title="HTML5 for everyone" /></p>'

img-idref | #55 | markd

u'![HTML5][h5]\n\n[h5]: http://www.w3.org/html/logo/img/mark-word-icon.png'

Normalized actual / expected:

u'<p>![HTML5][h5][h5]: http://www.w3.org/html/logo/img/mark-word-icon.png</p>'
u'<p><img alt="HTML5" src="http://www.w3.org/html/logo/img/mark-word-icon.png"></p>'

Raw actual / expected:

u'<p>![HTML5][h5][h5]: http://www.w3.org/html/logo/img/mark-word-icon.png</p>\n'
u'<p><img src="http://www.w3.org/html/logo/img/mark-word-icon.png" alt="HTML5" /></p>'

line-break-2-spaces | #61 | markd

u'A first sentence  \nand a line break.'

Normalized actual / expected:

u'<p>A first sentence and a line break.</p>'
u'<p>A first sentence<br>and a line break.</p>'

Raw actual / expected:

u'<p>A first sentence  and a line break.</p>\n'
u'<p>A first sentence<br />\nand a line break.</p>'

line-break-5-spaces | #62 | markd

u'A first sentence     \nand a line break.'

Normalized actual / expected:

u'<p>A first sentence and a line break.</p>'
u'<p>A first sentence<br>and a line break.</p>'

Raw actual / expected:

u'<p>A first sentence     and a line break.</p>\n'
u'<p>A first sentence<br />\nand a line break.</p>'

link-idref-angle-bracket | #66 | markd

u'[World Wide Web Consortium][w3c]\n\n[w3c]: <http://www.w3.org/>'

Normalized actual / expected:

u'<p>[World Wide Web Consortium][w3c][w3c]:<a href="http://www.w3.org/">http://www.w3.org/</a></p>'
u'<p><a href="http://www.w3.org/">World Wide Web Consortium</a></p>'

Raw actual / expected:

u'<p>[World Wide Web Consortium][w3c][w3c]: <a href="http://www.w3.org/">http://www.w3.org/</a></p>\n'
u'<p><a href="http://www.w3.org/">World Wide Web Consortium</a></p>'

link-idref-implicit-spaces | #67 | markd

u'[World Wide Web Consortium][]\n\n[World Wide Web Consortium]: http://www.w3.org/'

Normalized actual / expected:

u'<p>[World Wide Web Consortium][][World Wide Web Consortium]: http://www.w3.org/</p>'
u'<p><a href="http://www.w3.org/">World Wide Web Consortium</a></p>'

Raw actual / expected:

u'<p>[World Wide Web Consortium][][World Wide Web Consortium]: http://www.w3.org/</p>\n'
u'<p><a href="http://www.w3.org/">World Wide Web Consortium</a></p>'

link-idref-implicit | #68 | markd

u'[w3c][]\n\n[w3c]: http://www.w3.org/'

Normalized actual / expected:

u'<p>[w3c][][w3c]: http://www.w3.org/</p>'
u'<p><a href="http://www.w3.org/">w3c</a></p>'

Raw actual / expected:

u'<p>[w3c][][w3c]: http://www.w3.org/</p>\n'
u'<p><a href="http://www.w3.org/">w3c</a></p>'

link-idref-space | #69 | markd

u'[World Wide Web Consortium] [w3c]\n\n[w3c]: http://www.w3.org/'

Normalized actual / expected:

u'<p>[World Wide Web Consortium] [w3c][w3c]: http://www.w3.org/</p>'
u'<p><a href="http://www.w3.org/">World Wide Web Consortium</a></p>'

Raw actual / expected:

u'<p>[World Wide Web Consortium] [w3c][w3c]: http://www.w3.org/</p>\n'
u'<p><a href="http://www.w3.org/">World Wide Web Consortium</a></p>'

link-idref-title-next-line | #70 | markd

u'[World Wide Web Consortium][w3c]\n\n[w3c]: http://www.w3.org/\n   "Discover W3C"'

Normalized actual / expected:

u'<p>[World Wide Web Consortium][w3c][w3c]: http://www.w3.org/ "Discover W3C"</p>'
u'<p><a href="http://www.w3.org/" title="Discover W3C">World Wide Web Consortium</a></p>'

Raw actual / expected:

u'<p>[World Wide Web Consortium][w3c][w3c]: http://www.w3.org/   &quot;Discover W3C&quot;</p>\n'
u'<p><a href="http://www.w3.org/" title="Discover W3C">World Wide Web Consortium</a></p>'

link-idref-title-paranthesis | #71 | markd

u'[World Wide Web Consortium][w3c]\n\n[w3c]: http://www.w3.org/ (Discover w3c)'

Normalized actual / expected:

u'<p>[World Wide Web Consortium][w3c][w3c]: http://www.w3.org/ (Discover w3c)</p>'
u'<p><a href="http://www.w3.org/" title="Discover w3c">World Wide Web Consortium</a></p>'

Raw actual / expected:

u'<p>[World Wide Web Consortium][w3c][w3c]: http://www.w3.org/ (Discover w3c)</p>\n'
u'<p><a href="http://www.w3.org/" title="Discover w3c">World Wide Web Consortium</a></p>'

link-idref-title-single-quote | #72 | markd

u"[World Wide Web Consortium][w3c]\n\n[w3c]: http://www.w3.org/ 'Discover w3c'"

Normalized actual / expected:

u"<p>[World Wide Web Consortium][w3c][w3c]: http://www.w3.org/ 'Discover w3c'</p>"
u'<p><a href="http://www.w3.org/" title="Discover w3c">World Wide Web Consortium</a></p>'

Raw actual / expected:

u"<p>[World Wide Web Consortium][w3c][w3c]: http://www.w3.org/ 'Discover w3c'</p>\n"
u'<p><a href="http://www.w3.org/" title="Discover w3c">World Wide Web Consortium</a></p>'

link-idref-title | #73 | markd

u'[World Wide Web Consortium][w3c]\n\n[w3c]: http://www.w3.org/ "Discover w3c"'

Normalized actual / expected:

u'<p>[World Wide Web Consortium][w3c][w3c]: http://www.w3.org/ "Discover w3c"</p>'
u'<p><a href="http://www.w3.org/" title="Discover w3c">World Wide Web Consortium</a></p>'

Raw actual / expected:

u'<p>[World Wide Web Consortium][w3c][w3c]: http://www.w3.org/ &quot;Discover w3c&quot;</p>\n'
u'<p><a href="http://www.w3.org/" title="Discover w3c">World Wide Web Consortium</a></p>'

link-idref | #74 | markd

u'[World Wide Web Consortium][w3c]\n\n[w3c]: http://www.w3.org/'

Normalized actual / expected:

u'<p>[World Wide Web Consortium][w3c][w3c]: http://www.w3.org/</p>'
u'<p><a href="http://www.w3.org/">World Wide Web Consortium</a></p>'

Raw actual / expected:

u'<p>[World Wide Web Consortium][w3c][w3c]: http://www.w3.org/</p>\n'
u'<p><a href="http://www.w3.org/">World Wide Web Consortium</a></p>'

list-blockquote | #75 | markd

u'*   a list containing a blockquote\n\n    > this the blockquote in the list'

Normalized actual / expected:

u'<ul><li>a list containing a blockquote > this the blockquote in the list</li></ul>'
u'<ul><li><p>a list containing a blockquote</p><blockquote><p>this the blockquote in the list</p></blockquote></li></ul>'

Raw actual / expected:

u'<ul>\n<li>a list containing a blockquote    &gt; this the blockquote in the list</li>\n</ul>\n'
u'<ul>\n<li><p>a list containing a blockquote</p>\n\n<blockquote>\n<p>this the blockquote in the list</p>\n</blockquote></li>\n</ul>\n'

list-code-1-space | #76 | markd

u'* a\n\n        b\n'

Normalized actual / expected:

u'<ul><li>a b</li></ul>'
u'<ul><li><p>a</p><pre><code>b\n</code></pre></li></ul>'

Raw actual / expected:

u'<ul>\n<li>a        b</li>\n</ul>\n'
u'<ul>\n  <li>\n    <p>a</p>\n    <pre><code>b\n</code></pre>\n  </li>\n</ul>\n'

list-code | #77 | markd

u'*   a list containing a block of code\n\n\t    10 PRINT HELLO INFINITE\n\t    20 GOTO 10'

Normalized actual / expected:

u'<ul><li>a list containing a block of code 10 PRINT HELLO INFINITE 20 GOTO 10</li></ul>'
u'<ul><li><p>a list containing a block of code</p><pre><code>10 PRINT HELLO INFINITE\n20 GOTO 10\n</code></pre></li></ul>'

Raw actual / expected:

u'<ul>\n<li>a list containing a block of code\t    10 PRINT HELLO INFINITE\t    20 GOTO 10</li>\n</ul>\n'
u'<ul>\n<li><p>a list containing a block of code</p>\n\n<pre><code>10 PRINT HELLO INFINITE\n20 GOTO 10\n</code></pre></li>\n</ul>'

list-multiparagraphs-tab | #78 | markd

u'*   This is a list item with two paragraphs. Lorem ipsum dolor\n\tsit amet, consectetuer adipiscing elit. Aliquam hendrerit\n\tmi posuere lectus.\n\n\tVestibulum enim wisi, viverra nec, fringilla in, laoreet\n\tvitae, risus. Donec sit amet nisl. Aliquam semper ipsum\n\tsit amet velit.\n\n*   Suspendisse id sem consectetuer libero luctus adipiscing.'

Normalized actual / expected:

u'<ul><li>This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.* Suspendisse id sem consectetuer libero luctus adipiscing.</li></ul>'
u'<ul><li><p>This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.</p><p>Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.</p></li><li><p>Suspendisse id sem consectetuer libero luctus adipiscing.</p></li></ul>'

Raw actual / expected:

u'<ul>\n<li>This is a list item with two paragraphs. Lorem ipsum dolor\tsit amet, consectetuer adipiscing elit. Aliquam hendrerit\tmi posuere lectus.\tVestibulum enim wisi, viverra nec, fringilla in, laoreet\tvitae, risus. Donec sit amet nisl. Aliquam semper ipsum\tsit amet velit.*   Suspendisse id sem consectetuer libero luctus adipiscing.</li>\n</ul>\n'
u'<ul>\n<li><p>This is a list item with two paragraphs. Lorem ipsum dolor\nsit amet, consectetuer adipiscing elit. Aliquam hendrerit\nmi posuere lectus.</p>\n\n<p>Vestibulum enim wisi, viverra nec, fringilla in, laoreet\nvitae, risus. Donec sit amet nisl. Aliquam semper ipsum\nsit amet velit.</p></li>\n<li><p>Suspendisse id sem consectetuer libero luctus adipiscing.</p></li>\n</ul>'

list-multiparagraphs | #79 | markd

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

Normalized actual / expected:

u'<ul><li>This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.* Suspendisse id sem consectetuer libero luctus adipiscing.</li></ul>'
u'<ul><li><p>This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.</p><p>Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.</p></li><li><p>Suspendisse id sem consectetuer libero luctus adipiscing.</p></li></ul>'

Raw actual / expected:

u'<ul>\n<li>This is a list item with two paragraphs. Lorem ipsum dolor    sit amet, consectetuer adipiscing elit. Aliquam hendrerit    mi posuere lectus.    Vestibulum enim wisi, viverra nec, fringilla in, laoreet    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum    sit amet velit.*   Suspendisse id sem consectetuer libero luctus adipiscing.</li>\n</ul>\n'
u'<ul>\n<li><p>This is a list item with two paragraphs. Lorem ipsum dolor\nsit amet, consectetuer adipiscing elit. Aliquam hendrerit\nmi posuere lectus.</p>\n\n<p>Vestibulum enim wisi, viverra nec, fringilla in, laoreet\nvitae, risus. Donec sit amet nisl. Aliquam semper ipsum\nsit amet velit.</p></li>\n<li><p>Suspendisse id sem consectetuer libero luctus adipiscing.</p></li>\n</ul>'

ordered-list-inner-par-list | #81 | markd

u'1. 1\n\n    - inner par list\n\n2. 2\n'

Normalized actual / expected:

u'<ol><li>1 - inner par list2. 2</li></ol>'
u'<ol><li><p>1</p><ul><li>inner par list</li></ul></li><li><p>2</p></li></ol>'

Raw actual / expected:

u'<ol>\n<li>1    - inner par list2. 2</li>\n</ol>\n'
u'<ol>\n  <li>\n    <p>1</p>\n    <ul>\n      <li>inner par list</li>\n    </ul>\n  </li>\n  <li><p>2</p></li>\n</ol>\n'

ordered-list-items-random-number | #82 | markd

u'1. list item 1\n8. list item 2\n1. list item 3'

Normalized actual / expected:

u'<ol><li>list item 18. list item 21. list item 3</li></ol>'
u'<ol><li>list item 1</li><li>list item 2</li><li>list item 3</li></ol>'

Raw actual / expected:

u'<ol>\n<li>list item 18. list item 21. list item 3</li>\n</ol>\n'
u'<ol>\n<li>list item 1</li>\n<li>list item 2</li>\n<li>list item 3</li>\n</ol>'

ordered-list-items | #83 | markd

u'1. list item 1\n2. list item 2\n3. list item 3'

Normalized actual / expected:

u'<ol><li>list item 12. list item 23. list item 3</li></ol>'
u'<ol><li>list item 1</li><li>list item 2</li><li>list item 3</li></ol>'

Raw actual / expected:

u'<ol>\n<li>list item 12. list item 23. list item 3</li>\n</ol>\n'
u'<ol>\n<li>list item 1</li>\n<li>list item 2</li>\n<li>list item 3</li>\n</ol>'

paragraph-hard-return | #84 | markd

u'This is a paragraph\non multiple lines\nwith hard return.'

Normalized actual / expected:

u'<p>This is a paragraphon multiple lineswith hard return.</p>'
u'<p>This is a paragraph on multiple lines with hard return.</p>'

Raw actual / expected:

u'<p>This is a paragraphon multiple lineswith hard return.</p>\n'
u'<p>This is a paragraph\non multiple lines\nwith hard return.</p>'

unordered-list-items-asterisk | #95 | markd

u'* list item 1\n* list item 2\n* list item 3\n'

Normalized actual / expected:

u'<ul><li>list item 1* list item 2* list item 3</li></ul>'
u'<ul><li>list item 1</li><li>list item 2</li><li>list item 3</li></ul>'

Raw actual / expected:

u'<ul>\n<li>list item 1* list item 2* list item 3</li>\n</ul>\n'
u'<ul>\n<li>list item 1</li>\n<li>list item 2</li>\n<li>list item 3</li>\n</ul>'

unordered-list-items-dashsign | #96 | markd

u'- list item 1\n- list item 2\n- list item 3'

Normalized actual / expected:

u'<ul><li>list item 1- list item 2- list item 3</li></ul>'
u'<ul><li>list item 1</li><li>list item 2</li><li>list item 3</li></ul>'

Raw actual / expected:

u'<ul>\n<li>list item 1- list item 2- list item 3</li>\n</ul>\n'
u'<ul>\n<li>list item 1</li>\n<li>list item 2</li>\n<li>list item 3</li>\n</ul>'

unordered-list-items-leading-1space | #97 | markd

u' * list item 1\n * list item 2\n * list item 3'

Normalized actual / expected:

u'<ul><li>list item 1 * list item 2 * list item 3</li></ul>'
u'<ul><li>list item 1</li><li>list item 2</li><li>list item 3</li></ul>'

Raw actual / expected:

u'<ul>\n<li>list item 1 * list item 2 * list item 3</li>\n</ul>\n'
u'<ul>\n<li>list item 1</li>\n<li>list item 2</li>\n<li>list item 3</li>\n</ul>\n'

unordered-list-items-leading-2spaces | #98 | markd

u'  * list item 1\n  * list item 2\n  * list item 3'

Normalized actual / expected:

u'<ul><li>list item 1 * list item 2 * list item 3</li></ul>'
u'<ul><li>list item 1</li><li>list item 2</li><li>list item 3</li></ul>'

Raw actual / expected:

u'<ul>\n<li>list item 1  * list item 2  * list item 3</li>\n</ul>\n'
u'<ul>\n<li>list item 1</li>\n<li>list item 2</li>\n<li>list item 3</li>\n</ul>'

unordered-list-items-leading-3spaces | #99 | markd

u'   * list item 1\n   * list item 2\n   * list item 3'

Normalized actual / expected:

u'<ul><li>list item 1 * list item 2 * list item 3</li></ul>'
u'<ul><li>list item 1</li><li>list item 2</li><li>list item 3</li></ul>'

Raw actual / expected:

u'<ul>\n<li>list item 1   * list item 2   * list item 3</li>\n</ul>\n'
u'<ul>\n<li>list item 1</li>\n<li>list item 2</li>\n<li>list item 3</li>\n</ul>'

unordered-list-items-plussign | #100 | markd

u'+ list item 1\n+ list item 2\n+ list item 3'

Normalized actual / expected:

u'<ul><li>list item 1+ list item 2+ list item 3</li></ul>'
u'<ul><li>list item 1</li><li>list item 2</li><li>list item 3</li></ul>'

Raw actual / expected:

u'<ul>\n<li>list item 1+ list item 2+ list item 3</li>\n</ul>\n'
u'<ul>\n<li>list item 1</li>\n<li>list item 2</li>\n<li>list item 3</li>\n</ul>'

unordered-list-paragraphs | #101 | markd

u'* list item in paragraph\n\n* another list item in paragraph'

Normalized actual / expected:

u'<ul><li>list item in paragraph* another list item in paragraph</li></ul>'
u'<ul><li><p>list item in paragraph</p></li><li><p>another list item in paragraph</p></li></ul>'

Raw actual / expected:

u'<ul>\n<li>list item in paragraph* another list item in paragraph</li>\n</ul>\n'
u'<ul>\n<li><p>list item in paragraph</p></li>\n<li><p>another list item in paragraph</p></li>\n</ul>'

unordered-list-unindented-content | #102 | markd

u'*   This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph in a list.\n*   and yet another long long long long long long long long long long long long long long long long long long long long long long line.'

Normalized actual / expected:

u'<ul><li>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph in a list.* and yet another long long long long long long long long long long long long long long long long long long long long long long line.</li></ul>'
u'<ul><li>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph in a list.</li><li>and yet another long long long long long long long long long long long long long long long long long long long long long long line.</li></ul>'

Raw actual / expected:

u'<ul>\n<li>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph in a list.*   and yet another long long long long long long long long long long long long long long long long long long long long long long line.</li>\n</ul>\n'
u'<ul>\n<li>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph in a list.</li>\n<li>and yet another long long long long long long long long long long long long long long long long long long long long long long line.</li>\n</ul>'

unordered-list-with-indented-content | #103 | markd

u'*   This is a list item\n    with the content on\n    multiline and indented.\n*   And this another list item\n    with the same principle.'

Normalized actual / expected:

u'<ul><li>This is a list item with the content on multiline and indented.* And this another list item with the same principle.</li></ul>'
u'<ul><li>This is a list item with the content on multiline and indented.</li><li>And this another list item with the same principle.</li></ul>'

Raw actual / expected:

u'<ul>\n<li>This is a list item    with the content on    multiline and indented.*   And this another list item    with the same principle.</li>\n</ul>\n'
u'<ul>\n<li>This is a list item\nwith the content on\nmultiline and indented.</li>\n<li>And this another list item\nwith the same principle.</li>\n</ul>'

markd |FFFFFFFFF....FFF.FFFFFFFFFFF....F.FF.F...............FF.....FF...FFFFFFFFFFFFFF.FFFF..........FFFFFFFFF| 1.09s 103 58 5

I guess there is a thing or two that could be fixed.

Lesser-than sign in code block isn't escaped

This is a bug I detected while using the Crystal documentation generator, but since that uses markd, I'm assuming a bug report here makes more sense.

Creating documentation for the following code

# `<test`
module Test
end

inserts <code><test</code> into the final documentation. Expected behavior would be transforming < into &lt; inside code tags.

Enhance base URL resolution

Turns out #26 wasn't sufficient for my use case. For https://shardbox.org I want to resolve relative links in repo readmes, relative to the repo URL. But GitHub for example uses different base URLs depending on whether it points to a raw resource (image) or the online HTML page (link).

In order to achieve that, I'd like to pass the current node as an argument to resolve_uri to convey the context. For my use case that would be sufficient. I can simply use that method to hook into the renderer and add my custom implementation.

I'm not sure whether this use case is common enough to have that behaviour included in Makrd directly. I'm not even sure about the original base_url option.

So there are three options:

  1. Only add node argument to resolve_uri, keep its default implementation and Options#base_url. That's the minimal change solution.
  2. Add node argument to resolve_uri but remove Options#base_url and make its default implementation to just return destination. That essentially reverts half of #26 and leaves implementation of base URL entirely to the user. That's the overall minimum intrusion solution.
  3. Add node argument to resolve_uri and add separate properties to Options: #base_url_link and #base_url_image which will be selected depending on the node. That's the all-inclusive solution. Not sure if it's too specific.

I can send a PR for either option. Let me know what you think.

Error: no overload matches 'String#*' with type (Float64 | Int32)

getting a compilation error using Markd.to_html(markdown)

In lib/markd/src/markd/parsers/inline.cr:460:26

 460 | "\u{2014}" * em_count + "\u{2013}" * en_count
                  ^
Error: no overload matches 'String#*' with type (Float64 | Int32)

Overloads are:
 - String#*(times : Int)
Couldn't find overloads for these types:
 - String#*(times : Float64)

shards.yml

  markd:
    github: icyleaf/markd
    version: 0.1.2

If I change to "\u{2014}" * em_count.to_i + "\u{2013}" * en_count.to_i then it compiles and seems to work.

Markdown renderer

A renderer for markdown (markdown -> markdown, instead of just markdown -> HTML). This would be useful if you just want to insert/edit/remove parts of a markdown document (e.g. setting a default language for fenced code blocks).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.