We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ee7d1d commit 5ca3b97Copy full SHA for 5ca3b97
1 file changed
Sources/HTMLKit/Framework/Rendering/Encoding/Sanitizer.swift
@@ -0,0 +1,16 @@
1
+/// A type responsible for sanitizing the renderer output
2
+internal struct Sanitizer {
3
+
4
+ /// Strip a tag from a given string
5
+ ///
6
+ /// - Parameters:
7
+ /// - tag: The tag to remove
8
+ /// - string: The string to remove it from
9
10
+ /// - Returns: The sanitized string
11
+ internal func strip(_ tag: String, from string: String) -> String {
12
13
+ return string.replacingOccurrences(of: "<\(tag)>", with: "")
14
+ .replacingOccurrences(of: "</\(tag)>", with: "")
15
+ }
16
+}
0 commit comments