From 0b371c8103b49a1bc9cde99fc13dabc330e9936c Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 30 Oct 2018 13:55:08 +0100 Subject: fix html2markdown() and re-enable previously failing tests --- tests/unit/includes/MarkdownTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/unit/includes') diff --git a/tests/unit/includes/MarkdownTest.php b/tests/unit/includes/MarkdownTest.php index f0e253a58..c1408b303 100644 --- a/tests/unit/includes/MarkdownTest.php +++ b/tests/unit/includes/MarkdownTest.php @@ -52,12 +52,12 @@ class MarkdownTest extends UnitTestCase { '  ', '' ], -/* it is not clear why this test fails + 'strong, b, em, i, bib' => [ 'strong bold em italic boitalicld', '**strong** **bold** _em_ _italic_ **bo_italic_ld**' ], -*/ + 'empty tags' => [ 'text1 text2 ', 'text1 text2' @@ -118,12 +118,12 @@ class MarkdownTest extends UnitTestCase { '<p>HTML text</p>', '`

HTML text

`' ], -/* it is not clear why this test fails + 'pre' => [ '
   line with  spaces   
', '` line with spaces `' ], -*/ + 'div p' => [ '
div

p

', "
div
p\n\n
" -- cgit v1.2.3 From b4bac88c39c6bc6a0533114351ab9f5493aa46c9 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 30 Oct 2018 22:37:41 +0100 Subject: fix markdown tests --- tests/unit/includes/MarkdownTest.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'tests/unit/includes') diff --git a/tests/unit/includes/MarkdownTest.php b/tests/unit/includes/MarkdownTest.php index c1408b303..654fbd4c7 100644 --- a/tests/unit/includes/MarkdownTest.php +++ b/tests/unit/includes/MarkdownTest.php @@ -55,7 +55,7 @@ class MarkdownTest extends UnitTestCase { 'strong, b, em, i, bib' => [ 'strong bold em italic boitalicld', - '**strong** **bold** _em_ _italic_ **bo_italic_ld**' + '**strong** **bold** *em* *italic* **bo*italic*ld**' ], 'empty tags' => [ @@ -70,10 +70,6 @@ class MarkdownTest extends UnitTestCase { '& lt < gt >', '& lt < gt >' ], - 'our escaped HTML entities' => [ - '&_lt_; &_gt_; &_amp_;', - '&\_lt\_; &\_gt\_; &\_amp\_;' - ], 'linebreak' => [ "line1
line2\nline3", "line1 \nline2 line3" @@ -84,15 +80,15 @@ class MarkdownTest extends UnitTestCase { ], 'unordered list' => [ '', - "- Item 1\n- Item 2\n- Item 3" + "- Item 1\n- Item 2\n- Item **3**" ], 'ordered list' => [ '
  1. Item 1
  2. Item 2
  3. Item 3
', - "1. Item 1\n2. Item 2\n3. Item 3" + "1. Item 1\n2. Item 2\n3. Item **3**" ], 'nested lists' => [ '', - "- Item 1\n 1. Item 1a\n 2. Item 1b\n- Item 2" + "- Item 1\n 1. Item 1a\n 2. Item **1b**\n- Item 2" ], 'img' => [ 'alt text', @@ -118,12 +114,10 @@ class MarkdownTest extends UnitTestCase { '<p>HTML text</p>', '`

HTML text

`' ], - 'pre' => [ - '
   line with  spaces   
', - '` line with spaces `' + '
  one line with spaces  
', + '```\n one line with spaces \n```' ], - 'div p' => [ '
div

p

', "
div
p\n\n
" -- cgit v1.2.3 From fc6ff45c4976d158ac565a7693b2e4d30fe70e33 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 30 Oct 2018 22:51:52 +0100 Subject: fix another markdown test --- tests/unit/includes/MarkdownTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/unit/includes') diff --git a/tests/unit/includes/MarkdownTest.php b/tests/unit/includes/MarkdownTest.php index 654fbd4c7..61600988d 100644 --- a/tests/unit/includes/MarkdownTest.php +++ b/tests/unit/includes/MarkdownTest.php @@ -116,7 +116,7 @@ class MarkdownTest extends UnitTestCase { ], 'pre' => [ '
  one line with spaces  
', - '```\n one line with spaces \n```' + "```\n one line with spaces \n```" ], 'div p' => [ '
div

p

', -- cgit v1.2.3