Skip to content

Commit

Permalink
Merge pull request #106 from iseebi/escape-html-entities
Browse files Browse the repository at this point in the history
Escape HTML entities in HTML output support
  • Loading branch information
mono0926 authored Aug 10, 2019
2 parents 3e7e7cf + f983913 commit 51ec2ea
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
9 changes: 9 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@
"version": "0.9.0"
}
},
{
"package": "HTMLEntities",
"repositoryURL": "https://github.com/IBM-Swift/swift-html-entities.git",
"state": {
"branch": null,
"revision": "3b778b3ab061684db024eaf38c576887b42918aa",
"version": "3.0.13"
}
},
{
"package": "Yaml",
"repositoryURL": "https://github.com/behrang/YamlSwift.git",
Expand Down
5 changes: 4 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ let package = Package(
.package(url: "https://github.com/IBM-Swift/HeliumLogger.git",
from: "1.8.0"),
.package(url: "https://github.com/behrang/YamlSwift.git",
from: "3.4.0")
from: "3.4.0"),
.package(url: "https://github.com/IBM-Swift/swift-html-entities.git",
from: "3.0.0")
],
targets: [
.target(
Expand All @@ -33,6 +35,7 @@ let package = Package(
"APIKit",
"Commander",
"HeliumLogger",
"HTMLEntities",
"Yaml"
]
),
Expand Down
5 changes: 3 additions & 2 deletions Sources/LicensePlistCore/Entity/LicenseHTMLHolder.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Foundation
import LoggerAPI
import HTMLEntities

struct LicenseHTMLHolder {
let html: String
Expand All @@ -20,8 +21,8 @@ struct LicenseHTMLHolder {
"""
licenses.forEach { license in
html += """
<h2>\(license.name(withVersion: options.config.addVersionNumbers))</h2>
<pre>\(license.body)</pre>
<h2>\(license.name(withVersion: options.config.addVersionNumbers).htmlEscape())</h2>
<pre>\(license.body.htmlEscape())</pre>
"""
}
Expand Down

0 comments on commit 51ec2ea

Please sign in to comment.