Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit test to look at the bug #325 #333

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Adopt OKRs as a strategy execution framework

## Channel: OPSP 2023

## Tags: 2023Q3ROCKS

**Ações**

* ✅ [Apresentação](\"https://www.site.pt")
OKRs 101

* ✅ Titçe

* ![](\"https://www.site.pt")

* ✅ Definição de \"coaches\"

* John Doe

* ✅ Subtitle

* Q4 2023

* 🕒 Tool

* In evaluation
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This code is with an unordered list.

* Yes
* No
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Adopt OKRs as a strategy execution framework

## Channel: OPSP 2023

## Tags: 2023Q3ROCKS

**Ações**

* ✅ [Apresentação](\"https://www.site.pt")
OKRs 101

* ✅ Titçe

* ![](\"https://www.site.pt")

* ✅ Definição de \"coaches\"

* John Doe

* ✅ Subtitle

* Q4 2023

* 🕒 Tool

* In evaluation
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This code is with an unordered list.

* Yes
* No
48 changes: 44 additions & 4 deletions test/Html2Markdown.Test/MarkdownSchemeConverterTest.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Threading.Tasks;
using Html2Markdown.Scheme;
using NUnit.Framework;
using VerifyNUnit;

namespace Html2Markdown.Test;

Expand Down Expand Up @@ -564,7 +561,7 @@ public Task Convert_WhenThereAreEmptyUnorderedLists_ThenReplaceWithNothing()
}

[Test]
public Task Convert_WhenThereAreUnorderedListsWihtoutClosingTags_ThenReplaceWithMarkdownLists()
public Task Convert_WhenThereAreUnorderedListsWithoutClosingTags_ThenReplaceWithMarkdownLists()
{
const string html = @"This code is with an unordered list.<ul><li>Yes<li>No</ul>";

Expand Down Expand Up @@ -595,6 +592,49 @@ public Task Convert_WhenThereIsAnOrderedListWithANestedUnorderList_ThenReplaceWi
return CheckConversion(html);
}

// Refer to issue https://github.com/baynezy/Html2Markdown/issues/325
[Test]
public Task Convert_Bug325()
{
const string html = """
<h1>Adopt OKRs as a strategy execution framework</h1>
<h2>Channel: OPSP 2023</h2>
<h2>Tags: 2023Q3ROCKS</h2>
<p><strong>Ações</strong></p>
<ul>
<li>✅ <a
href=\"https://www.site.pt">Apresentação</a>
OKRs 101 </li>
<li>✅ Titçe
<ul>
<li><img
src=\"https://www.site.pt"></li>

</ul>
</li>
<li>✅ Definição de \"coaches\"
<ul>
<li>John Doe</li>
</ul>

</li>
<li>✅ Subtitle
<ul>
<li>Q4 2023</li>
</ul>
</li>
<li>🕒 Tool

<ul>
<li>In evaluation</li>
</ul>
</li>
</ul>
""";

return CheckConversion(html);
}

#endregion

#region Extra HTML Removal
Expand Down
Loading