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

Allow strong and b tags to have properties #361

Merged
merged 1 commit into from
Dec 20, 2023
Merged
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
522 changes: 509 additions & 13 deletions .gitignore

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions .idea/.idea.Html2Markdown/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/.idea.Html2Markdown/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/.idea.Html2Markdown/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.Html2Markdown/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class TextFormattingReplacementGroup : IReplacementGroup
},
new PatternReplacer
{
Pattern = "<(?:strong|b)>",
Pattern = @"<(?:strong|b)(:?\s[^>]*)?>",
Replacement = "**"
},
new PatternReplacer
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
So this text is **bold**. Convert it.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
So this text is **bold**. Convert it.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
So this text is **bold**. Convert it.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
So this text is **bold**. Convert it.
16 changes: 16 additions & 0 deletions test/Html2Markdown.Test/MarkdownSchemeConverterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,22 @@ public Task Convert_WhenThereAreBoldTags_ThenConvertToMarkDownDoubleAsterisks()

return CheckConversion(html);
}

[Test]
public Task Convert_WhenThereIsABoldTagWithProperties_ThenConvertToMarkDownDoubleAsterisks()
{
const string html = @"So this text is <b id=""something"">bold</b>. Convert it.";

return CheckConversion(html);
}

[Test]
public Task Convert_WhenThereIsAStrongTagWithProperties_ThenConvertToMarkDownDoubleAsterisks()
{
const string html = @"So this text is <strong id=""something"">bold</strong>. Convert it.";

return CheckConversion(html);
}

#endregion

Expand Down
Loading