From 425fde141f17973aea0a3a85e44632fe18737996 Mon Sep 17 00:00:00 2001 From: Mike Dirolf Date: Thu, 12 Jan 2012 23:20:45 -0500 Subject: attempt at a fix for issue w/ MD links inside of html tagish stuff with safe mode on. --- tests/html4_safe/link.html | 1 + tests/html4_safe/link.txt | 1 + tests/html4_safe/test.cfg | 3 +++ 3 files changed, 5 insertions(+) create mode 100644 tests/html4_safe/link.html create mode 100644 tests/html4_safe/link.txt create mode 100644 tests/html4_safe/test.cfg (limited to 'tests') diff --git a/tests/html4_safe/link.html b/tests/html4_safe/link.html new file mode 100644 index 0000000..642f4be --- /dev/null +++ b/tests/html4_safe/link.html @@ -0,0 +1 @@ +

<here gmail.com is a link>

\ No newline at end of file diff --git a/tests/html4_safe/link.txt b/tests/html4_safe/link.txt new file mode 100644 index 0000000..28331a7 --- /dev/null +++ b/tests/html4_safe/link.txt @@ -0,0 +1 @@ + diff --git a/tests/html4_safe/test.cfg b/tests/html4_safe/test.cfg new file mode 100644 index 0000000..66f7bf0 --- /dev/null +++ b/tests/html4_safe/test.cfg @@ -0,0 +1,3 @@ +[DEFAULT] +output_format=html4 +safe_mode=escape -- cgit v1.2.3 From 44caa3aaa1022532f3ecdada6cff7fe5fd0a2c44 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Fri, 30 Dec 2011 05:19:46 +0800 Subject: Fixed #57. Multiline HTML Blocks no longer require a blank line after them. --- tests/misc/multi-line-tags.html | 10 +++++++++- tests/misc/multi-line-tags.txt | 7 +++++++ tests/misc/multiline-comments.html | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/misc/multi-line-tags.html b/tests/misc/multi-line-tags.html index 784c1dd..69899aa 100644 --- a/tests/misc/multi-line-tags.html +++ b/tests/misc/multi-line-tags.html @@ -2,4 +2,12 @@ asdf asdfasd - \ No newline at end of file + + +
+ +foo bar + +
+ +

No blank line.

\ No newline at end of file diff --git a/tests/misc/multi-line-tags.txt b/tests/misc/multi-line-tags.txt index 4ea3b02..9056473 100644 --- a/tests/misc/multi-line-tags.txt +++ b/tests/misc/multi-line-tags.txt @@ -4,3 +4,10 @@ asdf asdfasd + +
+ +foo bar + +
+No blank line. diff --git a/tests/misc/multiline-comments.html b/tests/misc/multiline-comments.html index 12f8cb5..29c17e9 100644 --- a/tests/misc/multiline-comments.html +++ b/tests/misc/multiline-comments.html @@ -2,7 +2,7 @@ foo ---> +-->

-- cgit v1.2.3 From 5d177e635c4c0c5ce2db636ba395d0d9b715892d Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Fri, 30 Dec 2011 06:31:32 +0800 Subject: Fixed #68. Blank line is not required after html comments. Interestingly, the change to the misc/mismatched-tags test is inline with PHP Markdown Extra's behavior but not markdown.pl, which produces invalid html. --- tests/misc/comments.html | 6 +++++- tests/misc/comments.txt | 3 +++ tests/misc/mismatched-tags.html | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/misc/comments.html b/tests/misc/comments.html index 005a755..2240ab9 100644 --- a/tests/misc/comments.html +++ b/tests/misc/comments.html @@ -2,4 +2,8 @@

X>0

-
as if
\ No newline at end of file +
as if
+ + + +

no blank line

\ No newline at end of file diff --git a/tests/misc/comments.txt b/tests/misc/comments.txt index 68302b0..d9186f0 100644 --- a/tests/misc/comments.txt +++ b/tests/misc/comments.txt @@ -5,3 +5,6 @@ X>0
as if
+ + +__no blank line__ diff --git a/tests/misc/mismatched-tags.html b/tests/misc/mismatched-tags.html index ec087e1..06bd57f 100644 --- a/tests/misc/mismatched-tags.html +++ b/tests/misc/mismatched-tags.html @@ -6,6 +6,9 @@

And this output

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

-

text


+ +

text

+ +


Should be in p

\ No newline at end of file -- cgit v1.2.3 From a2377e1129331430998de821ed3abf38247edca1 Mon Sep 17 00:00:00 2001 From: Mike Dirolf Date: Sat, 14 Jan 2012 13:10:44 -0500 Subject: When safe mode is 'escape', don't allow bad html to stop further processing. See tests/html4_safe/html_then_blockquote.(txt|html). It looks like having unclosed block-level html elements was causing further processing not to happen, even in the case where we're escaping HTML. Since we're escaping HTML, it seems like it shouldn't affect processing at all. This changes output results in a couple of other tests, but the new output seems reasonable to me. --- tests/html4_safe/html_then_blockquote.html | 6 ++++++ tests/html4_safe/html_then_blockquote.txt | 6 ++++++ tests/safe_mode/inline-html-simple.html | 11 +++++++---- tests/safe_mode/script_tags.html | 26 +++++++++----------------- 4 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 tests/html4_safe/html_then_blockquote.html create mode 100644 tests/html4_safe/html_then_blockquote.txt (limited to 'tests') diff --git a/tests/html4_safe/html_then_blockquote.html b/tests/html4_safe/html_then_blockquote.html new file mode 100644 index 0000000..5833cd4 --- /dev/null +++ b/tests/html4_safe/html_then_blockquote.html @@ -0,0 +1,6 @@ +

to:

+

<td /><td style="text-align: center; white-space: nowrap;"><br />

+
+

3) You don't need to alter all localization files. + Adding the new labels to the en_US files will do it.

+
\ No newline at end of file diff --git a/tests/html4_safe/html_then_blockquote.txt b/tests/html4_safe/html_then_blockquote.txt new file mode 100644 index 0000000..544df67 --- /dev/null +++ b/tests/html4_safe/html_then_blockquote.txt @@ -0,0 +1,6 @@ +to: + +
+ +> 3) You don't need to alter all localization files. +> Adding the new labels to the en_US files will do it. diff --git a/tests/safe_mode/inline-html-simple.html b/tests/safe_mode/inline-html-simple.html index ad19a77..aca9af0 100644 --- a/tests/safe_mode/inline-html-simple.html +++ b/tests/safe_mode/inline-html-simple.html @@ -29,7 +29,8 @@ Blah
<!-- Comment -->
 

Just plain comment, with trailing spaces on the line:

-

<!-- foo -->

+

<!-- foo -->
+

Code:

<hr />
 
@@ -37,9 +38,11 @@ Blah

<hr>

<hr/>

<hr />

-

<hr>

-

<hr/>

-

<hr />

+

<hr>
+

+

<hr/>
+

+

<hr />

<hr class="foo" id="bar" />

<hr class="foo" id="bar"/>

<hr class="foo" id="bar" >

\ No newline at end of file diff --git a/tests/safe_mode/script_tags.html b/tests/safe_mode/script_tags.html index df63ffc..f3b059d 100644 --- a/tests/safe_mode/script_tags.html +++ b/tests/safe_mode/script_tags.html @@ -1,13 +1,11 @@

This should be stripped/escaped in safe_mode.

<script> -alert("Hello world!") +alert("Hello world!") </script>

With blank lines.

-

<script> - -alert("Hello world!") - -</script>

+

<script>

+

alert("Hello world!")

+

</script>

Now with some weirdness

<script <!-- alert("Hello world!") @@ -15,14 +13,8 @@ alert("Hello world!")

Try another way.

<script <!-- alert("Hello world!") -</script <> - -This time with blank lines. - -<script <!-- - -alert("Hello world!") - -</script <> - -

\ No newline at end of file +</script <>

+

This time with blank lines.

+

<script <!--

+

alert("Hello world!")

+

</script <>

\ No newline at end of file -- cgit v1.2.3 From a9179833ae458861d8a4d72336a1df4ee4f6d070 Mon Sep 17 00:00:00 2001 From: Mike Dirolf Date: Tue, 17 Jan 2012 16:00:31 -0500 Subject: Fenced code blocks need to end with a fence on its own line. --- tests/extensions/fenced_code.html | 32 ++++++++++++++++++++++++++++++++ tests/extensions/fenced_code.txt | 34 ++++++++++++++++++++++++++++++++++ tests/extensions/test.cfg | 3 +++ 3 files changed, 69 insertions(+) create mode 100644 tests/extensions/fenced_code.html create mode 100644 tests/extensions/fenced_code.txt (limited to 'tests') diff --git a/tests/extensions/fenced_code.html b/tests/extensions/fenced_code.html new file mode 100644 index 0000000..7b86e79 --- /dev/null +++ b/tests/extensions/fenced_code.html @@ -0,0 +1,32 @@ +

index 0000000..6e956a9

+
--- /dev/null
++++ b/test/data/stripped_text/mike-30-lili
+@@ -0,0 +1,27 @@
++Summary:
++ drift_mod.py |    1 +
++ 1 files changed, 1 insertions(+), 0 deletions(-)
++
++commit da4bfb04debdd994683740878d09988b2641513d
++Author: Mike Dirolf <mike@dirolf.com>
++Date:   Tue Jan 17 13:42:28 2012 -0500
++
++```
++minor: just wanted to push something.
++```
++
++diff --git a/drift_mod.py b/drift_mod.py
++index 34dfba6..8a88a69 100644
++
++```
++--- a/drift_mod.py
+++++ b/drift_mod.py
++@@ -281,6 +281,7 @@ CONTEXT_DIFF_LINE_PATTERN = re.compile(r'^('
++                                        '|\+ .*'
++                                        '|- .*'
++                                        ')$')
+++
++ def wrap_context_diffs(message_text):
++     return _wrap_diff(CONTEXT_DIFF_HEADER_PATTERN,
++                       CONTEXT_DIFF_LINE_PATTERN,
++```
+
\ No newline at end of file diff --git a/tests/extensions/fenced_code.txt b/tests/extensions/fenced_code.txt new file mode 100644 index 0000000..73c0337 --- /dev/null +++ b/tests/extensions/fenced_code.txt @@ -0,0 +1,34 @@ +index 0000000..6e956a9 + +``` +--- /dev/null ++++ b/test/data/stripped_text/mike-30-lili +@@ -0,0 +1,27 @@ ++Summary: ++ drift_mod.py | 1 + ++ 1 files changed, 1 insertions(+), 0 deletions(-) ++ ++commit da4bfb04debdd994683740878d09988b2641513d ++Author: Mike Dirolf ++Date: Tue Jan 17 13:42:28 2012 -0500 ++ ++``` ++minor: just wanted to push something. ++``` ++ ++diff --git a/drift_mod.py b/drift_mod.py ++index 34dfba6..8a88a69 100644 ++ ++``` ++--- a/drift_mod.py +++++ b/drift_mod.py ++@@ -281,6 +281,7 @@ CONTEXT_DIFF_LINE_PATTERN = re.compile(r'^(' ++ '|\+ .*' ++ '|- .*' ++ ')$') +++ ++ def wrap_context_diffs(message_text): ++ return _wrap_diff(CONTEXT_DIFF_HEADER_PATTERN, ++ CONTEXT_DIFF_LINE_PATTERN, ++``` +``` diff --git a/tests/extensions/test.cfg b/tests/extensions/test.cfg index c25bdfb..f3d0321 100644 --- a/tests/extensions/test.cfg +++ b/tests/extensions/test.cfg @@ -20,3 +20,6 @@ extensions=toc [wikilinks] extensions=wikilinks + +[fenced_code] +extensions=fenced_code -- cgit v1.2.3 From 69b365d07c7fabb206d9094398de2162cbcf6ba3 Mon Sep 17 00:00:00 2001 From: Mike Dirolf Date: Tue, 17 Jan 2012 16:52:39 -0500 Subject: Support github-flavored markdown by making the '.' optional before language type. --- tests/extensions/github_flavored.html | 32 ++++++++++++++++++++++++++++++++ tests/extensions/github_flavored.txt | 34 ++++++++++++++++++++++++++++++++++ tests/extensions/test.cfg | 3 +++ 3 files changed, 69 insertions(+) create mode 100644 tests/extensions/github_flavored.html create mode 100644 tests/extensions/github_flavored.txt (limited to 'tests') diff --git a/tests/extensions/github_flavored.html b/tests/extensions/github_flavored.html new file mode 100644 index 0000000..60e16b1 --- /dev/null +++ b/tests/extensions/github_flavored.html @@ -0,0 +1,32 @@ +

index 0000000..6e956a9

+
--- /dev/null
++++ b/test/data/stripped_text/mike-30-lili
+@@ -0,0 +1,27 @@
++Summary:
++ drift_mod.py |    1 +
++ 1 files changed, 1 insertions(+), 0 deletions(-)
++
++commit da4bfb04debdd994683740878d09988b2641513d
++Author: Mike Dirolf <mike@dirolf.com>
++Date:   Tue Jan 17 13:42:28 2012 -0500
++
++```
++minor: just wanted to push something.
++```
++
++diff --git a/drift_mod.py b/drift_mod.py
++index 34dfba6..8a88a69 100644
++
++```
++--- a/drift_mod.py
+++++ b/drift_mod.py
++@@ -281,6 +281,7 @@ CONTEXT_DIFF_LINE_PATTERN = re.compile(r'^('
++                                        '|\+ .*'
++                                        '|- .*'
++                                        ')$')
+++
++ def wrap_context_diffs(message_text):
++     return _wrap_diff(CONTEXT_DIFF_HEADER_PATTERN,
++                       CONTEXT_DIFF_LINE_PATTERN,
++```
+
\ No newline at end of file diff --git a/tests/extensions/github_flavored.txt b/tests/extensions/github_flavored.txt new file mode 100644 index 0000000..d0737bd --- /dev/null +++ b/tests/extensions/github_flavored.txt @@ -0,0 +1,34 @@ +index 0000000..6e956a9 + +```diff +--- /dev/null ++++ b/test/data/stripped_text/mike-30-lili +@@ -0,0 +1,27 @@ ++Summary: ++ drift_mod.py | 1 + ++ 1 files changed, 1 insertions(+), 0 deletions(-) ++ ++commit da4bfb04debdd994683740878d09988b2641513d ++Author: Mike Dirolf ++Date: Tue Jan 17 13:42:28 2012 -0500 ++ ++``` ++minor: just wanted to push something. ++``` ++ ++diff --git a/drift_mod.py b/drift_mod.py ++index 34dfba6..8a88a69 100644 ++ ++``` ++--- a/drift_mod.py +++++ b/drift_mod.py ++@@ -281,6 +281,7 @@ CONTEXT_DIFF_LINE_PATTERN = re.compile(r'^(' ++ '|\+ .*' ++ '|- .*' ++ ')$') +++ ++ def wrap_context_diffs(message_text): ++ return _wrap_diff(CONTEXT_DIFF_HEADER_PATTERN, ++ CONTEXT_DIFF_LINE_PATTERN, ++``` +``` diff --git a/tests/extensions/test.cfg b/tests/extensions/test.cfg index f3d0321..ebe9a8f 100644 --- a/tests/extensions/test.cfg +++ b/tests/extensions/test.cfg @@ -23,3 +23,6 @@ extensions=wikilinks [fenced_code] extensions=fenced_code + +[github_flavored] +extensions=codehilite,fenced_code -- cgit v1.2.3