Posted by vladimir.dolgopolov on June 2, 2008 at 10:06am
| Project: | Markdown filter |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
I have created the tests for syntax checking of the module.
This tests based on:
http://daringfireball.net/projects/markdown/syntax
http://michelf.com/projects/php-markdown/extra/
http://daringfireball.net/projects/smartypants/
Just uncompress the archive in marksmarty/test dir.
| Attachment | Size |
|---|---|
| marksmarty_tests.zip | 14.38 KB |
Comments
#1
This is a very useful module.
There are several issues I've found while testing.
I use spaces to get html with tags more clearly.
1) Backslash escapes emphasis:
Input:
\__escaped double underscores_\_
Expected:
<p>& #95;<em>escaped double underscores</em>& #95;</p>
Result:
<p>& #95;_escaped double underscores_& #95;</p>
2) Links (reference):
Input:
A [link with title single quotes][].
[link with title single quotes]: http://example.com 'Title for the link'
Expected:
<p>A <a href="http://example.com" title="Title for the link">link with title single quotes</a>.</p>
Result:
A [link with title single quotes][].
[link with title single quotes]: http://example.com 'Title for the link'
3) Links (auto):
Input:
< address@example.com >
Expected:
<p><a href="& #x6d;& #97;& #x69;& #108;& #116;& #x6f;& #58;& #x3c;& #x61;& #100;& #x64;& #114;e& #x73;& #115;& #x40;& #101;& #120;& #x61;& #109;p& #x6c;& #101;& #x2e;& #99;& #111;& #x6d;& #62;">& #x3c;& #x61;& #100;& #x64;& #114;e& #x73;& #115;& #x40;& #101;& #120;& #x61;& #109;p& #x6c;& #101;& #x2e;& #99;& #111;& #x6d;& #62;</a></p>
Result:
<p><</p>
<p>address@example.com></p>
4) Images (inline):
Input (notice the space between ']' and '('):
This is ![a wrong image] (/relative/image.gif).
Expected:
<p>This is ![a wrong image] (/relative/image.gif).</p>
Result:
<p>This is <img src="/relative/image.gif" alt="a wrong image" />.</p>
5) Images (reference):
Input:
An ![image with title single quotes][].
[image with title single quotes]: http://example.com/image.jpg 'Title for the image'
Expected:
<p>An <img src="http://example.com/image.jpg" alt="image with title single quotes" title="Title for the image" />.</p>
Result:
<p>An ![image with title single quotes][].</p>
<p>[image with title single quotes]: http://example.com/image.jpg 'Title for the image'</p>
6) Extra:
Input:
~~~
code line 1
code line 2
code line 3
~~~
Expected:
< pre >< code >code line 1
code line 2
code line 3
</ code ></ pre >
Result:
<p>~~~</p>
<p>code line 1
code line 2</p>
<p>code line 3</p>
<p>~~~</p>
#2
Recategorizing against Markdown filter. Vladimir, can you please rerun the tests against the new markdown code. The markdown module includes an updated version of the markdown parser now so it might not fail as much.
#3
I've rerun tests again. I modified the tests slightly.
There are results:
1) Backslash escapes emphasis - fails the same
2) Links (reference) - fails the same
3) Links (auto) - works, great!
4) Images (inline) - fails the same
5) Images (reference) - fails the same
6) Extra - works, great!
#4
I guess this is a related issue, although I don't fully know but in my installation (Drupal 6.6, Markdown 6.x.1.1), the image and link syntax does not work when wrapped in
<p></p>.