diff --git a/Package.swift b/Package.swift index e7f9d82..bd7ae28 100644 --- a/Package.swift +++ b/Package.swift @@ -6,7 +6,7 @@ import PackageDescription let package = Package( name: "SwiftHTMLtoMarkdown", platforms: [ - .iOS(.v15), + .iOS(.v16), .macOS(.v13) ], products: [ diff --git a/Sources/SwiftHTMLtoMarkdown/BasicHTML.swift b/Sources/SwiftHTMLtoMarkdown/BasicHTML.swift index fa97bd7..00ce01f 100644 --- a/Sources/SwiftHTMLtoMarkdown/BasicHTML.swift +++ b/Sources/SwiftHTMLtoMarkdown/BasicHTML.swift @@ -57,14 +57,14 @@ public class BasicHTML: HTML { let href = try node.attr("href") markdown += "(\(href))" return - } else if node.nodeName() == "strong" { + } else if node.nodeName() == "strong" || node.nodeName() == "b" { markdown += "**" for child in node.getChildNodes() { try convertNode(child) } markdown += "**" return - } else if node.nodeName() == "em" { + } else if node.nodeName() == "em" || node.nodeName() == "i" { markdown += "*" for child in node.getChildNodes() { try convertNode(child) diff --git a/Tests/SwiftHTMLtoMarkdownTests/BasicHTMLTests.swift b/Tests/SwiftHTMLtoMarkdownTests/BasicHTMLTests.swift index cfdfb3f..cf9a816 100644 --- a/Tests/SwiftHTMLtoMarkdownTests/BasicHTMLTests.swift +++ b/Tests/SwiftHTMLtoMarkdownTests/BasicHTMLTests.swift @@ -20,11 +20,12 @@ final class BasicHTMLTests: XCTestCase {
Heading level 6

I just love bold text.

-

Loveisbold

- +

Loveisbold

+

Italicized text is the cat's meow.

-

Acatsmeow

- + +

Acatsmeow

+

This text is really important.

This is some code Hello World!