[I]f the number is in the range 0x0001 to 0x0008, 0x000D to 0x001F, 0x007F
+
“[I]f the number is in the range 0x0001 to 0x0008, 0x000D to 0x001F, 0x007F
to 0x009F, 0xFDD0 to 0xFDEF, or is one of 0x000B, 0xFFFE, 0xFFFF, 0x1FFFE,
0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE, 0x3FFFF, 0x4FFFE, 0x4FFFF, 0x5FFFE,
0x5FFFF, 0x6FFFE, 0x6FFFF, 0x7FFFE, 0x7FFFF, 0x8FFFE, 0x8FFFF, 0x9FFFE,
0x9FFFF, 0xAFFFE, 0xAFFFF, 0xBFFFE, 0xBFFFF, 0xCFFFE, 0xCFFFF, 0xDFFFE,
0xDFFFF, 0xEFFFE, 0xEFFFF, 0xFFFFE, 0xFFFFF, 0x10FFFE, or 0x10FFFF, then
-this is a parse error.
[I]f the characters after the U+0026 AMPERSAND character (&) consist of
+
“[I]f the characters after the U+0026 AMPERSAND character (&) consist of
a sequence of one or more alphanumeric ASCII characters followed by a
-U+003B SEMICOLON character (;), then this is a parse error.
+U+003B SEMICOLON character (;), then this is a parse error.”
If no characters match the range, then don’t consume any characters
+
“If no characters match the range, then don’t consume any characters
(and unconsume the U+0023 NUMBER SIGN character and, if appropriate,
-the X character). This is a parse error; nothing is returned.
+the X character). This is a parse error; nothing is returned.”
importPackageDescriptionletpackage=Package(name:"<package-name>",...dependencies:[
- .package(url:"https://github.com/IBM-Swift/swift-html-entities.git",.upToNextMajor(from:"3.0.0")
+ .package(url:"https://github.com/Kitura/swift-html-entities.git",from:"3.0.0")]// Also, make sure to add HTMLEntities to your package target's dependencies)
@@ -139,13 +126,13 @@
Via CocoaPods
Add HTMLEntities to your Podfile:
target '<project-name>' do
- pod 'HTMLEntities', :git => 'https://github.com/IBM-Swift/swift-html-entities.git'
+ pod 'HTMLEntities', :git => 'https://github.com/Kitura/swift-html-entities.git'
end
Via Carthage
Add HTMLEntities to your Cartfile:
-
github "IBM-Swift/swift-html-entities"
+
github "Kitura/swift-html-entities"
Usage
importHTMLEntities
@@ -225,7 +212,7 @@
useNamedReferences
Set Escape Options Globally
-
HTML escape options can be set globally so that you don’t have to set them everytime you want to escape a string. The options are managed in the String.HTMLEscapeOptions struct.
+
HTML escape options can be set globally so that you don’t have to set them everytime you want to escape a string. The options are managed in the String.HTMLEscapeOptions struct.
importHTMLEntities// set `useNamedReferences` to `true` globally
@@ -252,7 +239,7 @@
strict
lettext="한"print(text.htmlUnescape())
-// Prints "한"
+// Prints "한"print(trytext.htmlUnescape(strict:true))// Throws a `ParseError.MissingSemicolon` instance
@@ -260,7 +247,7 @@
strict
// a throwing function because `strict` is passed in argument// but no error is thrown because `strict: false`print(trytext.htmlUnescape(strict:false))
-// Prints "한"
+// Prints "한"
Return string as HTML escaped by replacing non-ASCII and unsafe characters","parent_name":"String"},"Extensions/String.html#/s:SS12HTMLEntitiesE12htmlUnescapeSSSb6strict_tKF":{"name":"htmlUnescape(strict:)","abstract":"
Return string as HTML unescaped by replacing HTML character references with their","parent_name":"String"},"Extensions/String.html#/s:SS12HTMLEntitiesE12htmlUnescapeSSyF":{"name":"htmlUnescape()","abstract":"
Return string as HTML unescaped by replacing HTML character references with their","parent_name":"String"},"Extensions/String.html":{"name":"String"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO26DeprecatedNumericReferenceACSScACmF":{"name":"DeprecatedNumericReference","abstract":"
If that number is one of the numbers in the first column of the following","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO26DisallowedNumericReferenceACSScACmF":{"name":"DisallowedNumericReference","abstract":"
[I]f the number is in the range 0x0001 to 0x0008, 0x000D to 0x001F, 0x007F","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO15IllegalArgumentACSScACmF":{"name":"IllegalArgument","abstract":"
This should NEVER be hit in code execution. If this error is thrown, then","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO21InvalidNamedReferenceACSScACmF":{"name":"InvalidNamedReference","abstract":"
[I]f the characters after the U+0026 AMPERSAND character (&) consist of","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO25MalformedNumericReferenceACSScACmF":{"name":"MalformedNumericReference","abstract":"
If no characters match the range, then don’t consume any characters","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO16MissingSemicolonACSScACmF":{"name":"MissingSemicolon","abstract":"
[I]f the next character is a U+003B SEMICOLON, consume that too.","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO24OutsideValidUnicodeRangeACSScACmF":{"name":"OutsideValidUnicodeRange","abstract":"
[I]f the number is in the range 0xD800 to 0xDFFF or is greater","parent_name":"ParseError"},"Enums/ParseError.html":{"name":"ParseError","abstract":"
Enums used to delineate the different kinds of parse errors"},"Enums.html":{"name":"Enums","abstract":"
"}}
\ No newline at end of file
+{"Extensions/String/HTMLEscapeOptions.html#/s:SS12HTMLEntitiesE17HTMLEscapeOptionsV18allowUnsafeSymbolsSbvpZ":{"name":"allowUnsafeSymbols","abstract":"
Specifies if all ASCII characters should be skipped when escaping text
Return string as HTML escaped by replacing non-ASCII and unsafe characters","parent_name":"String"},"Extensions/String.html#/s:SS12HTMLEntitiesE12htmlUnescape6strictSSSb_tKF":{"name":"htmlUnescape(strict:)","abstract":"
Return string as HTML unescaped by replacing HTML character references with their","parent_name":"String"},"Extensions/String.html#/s:SS12HTMLEntitiesE12htmlUnescapeSSyF":{"name":"htmlUnescape()","abstract":"
Return string as HTML unescaped by replacing HTML character references with their","parent_name":"String"},"Extensions/String.html":{"name":"String","abstract":"
This String extension provides utility functions to convert strings to their"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO26DeprecatedNumericReferenceyACSScACmF":{"name":"DeprecatedNumericReference(_:)","abstract":"
“If that number is one of the numbers in the first column of the following","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO26DisallowedNumericReferenceyACSScACmF":{"name":"DisallowedNumericReference(_:)","abstract":"
“[I]f the number is in the range 0x0001 to 0x0008, 0x000D to 0x001F, 0x007F","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO15IllegalArgumentyACSScACmF":{"name":"IllegalArgument(_:)","abstract":"
This should NEVER be hit in code execution. If this error is thrown, then","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO21InvalidNamedReferenceyACSScACmF":{"name":"InvalidNamedReference(_:)","abstract":"
“[I]f the characters after the U+0026 AMPERSAND character (&) consist of","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO25MalformedNumericReferenceyACSScACmF":{"name":"MalformedNumericReference(_:)","abstract":"
“If no characters match the range, then don’t consume any characters","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO16MissingSemicolonyACSScACmF":{"name":"MissingSemicolon(_:)","abstract":"
“[I]f the next character is a U+003B SEMICOLON, consume that too.","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO24OutsideValidUnicodeRangeyACSScACmF":{"name":"OutsideValidUnicodeRange(_:)","abstract":"
“[I]f the number is in the range 0xD800 to 0xDFFF or is greater","parent_name":"ParseError"},"Enums/ParseError.html":{"name":"ParseError","abstract":"
Enums used to delineate the different kinds of parse errors"},"Enums.html":{"name":"Enumerations","abstract":"
The following enumerations are available globally.
importPackageDescriptionletpackage=Package(name:"<package-name>",...dependencies:[
- .package(url:"https://github.com/IBM-Swift/swift-html-entities.git",.upToNextMajor(from:"3.0.0")
+ .package(url:"https://github.com/Kitura/swift-html-entities.git",from:"3.0.0")]// Also, make sure to add HTMLEntities to your package target's dependencies)
@@ -139,13 +126,13 @@
Via CocoaPods
Add HTMLEntities to your Podfile:
target '<project-name>' do
- pod 'HTMLEntities', :git => 'https://github.com/IBM-Swift/swift-html-entities.git'
+ pod 'HTMLEntities', :git => 'https://github.com/Kitura/swift-html-entities.git'
end
Via Carthage
Add HTMLEntities to your Cartfile:
-
github "IBM-Swift/swift-html-entities"
+
github "Kitura/swift-html-entities"
Usage
importHTMLEntities
@@ -225,7 +212,7 @@
useNamedReferences
Set Escape Options Globally
-
HTML escape options can be set globally so that you don’t have to set them everytime you want to escape a string. The options are managed in the String.HTMLEscapeOptions struct.
+
HTML escape options can be set globally so that you don’t have to set them everytime you want to escape a string. The options are managed in the String.HTMLEscapeOptions struct.
importHTMLEntities// set `useNamedReferences` to `true` globally
@@ -252,7 +239,7 @@
strict
lettext="한"print(text.htmlUnescape())
-// Prints "한"
+// Prints "한"print(trytext.htmlUnescape(strict:true))// Throws a `ParseError.MissingSemicolon` instance
@@ -260,7 +247,7 @@
strict
// a throwing function because `strict` is passed in argument// but no error is thrown because `strict: false`print(trytext.htmlUnescape(strict:false))
-// Prints "한"
+// Prints "한"
Return string as HTML escaped by replacing non-ASCII and unsafe characters","parent_name":"String"},"Extensions/String.html#/s:SS12HTMLEntitiesE12htmlUnescapeSSSb6strict_tKF":{"name":"htmlUnescape(strict:)","abstract":"
Return string as HTML unescaped by replacing HTML character references with their","parent_name":"String"},"Extensions/String.html#/s:SS12HTMLEntitiesE12htmlUnescapeSSyF":{"name":"htmlUnescape()","abstract":"
Return string as HTML unescaped by replacing HTML character references with their","parent_name":"String"},"Extensions/String.html":{"name":"String"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO26DeprecatedNumericReferenceACSScACmF":{"name":"DeprecatedNumericReference","abstract":"
If that number is one of the numbers in the first column of the following","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO26DisallowedNumericReferenceACSScACmF":{"name":"DisallowedNumericReference","abstract":"
[I]f the number is in the range 0x0001 to 0x0008, 0x000D to 0x001F, 0x007F","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO15IllegalArgumentACSScACmF":{"name":"IllegalArgument","abstract":"
This should NEVER be hit in code execution. If this error is thrown, then","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO21InvalidNamedReferenceACSScACmF":{"name":"InvalidNamedReference","abstract":"
[I]f the characters after the U+0026 AMPERSAND character (&) consist of","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO25MalformedNumericReferenceACSScACmF":{"name":"MalformedNumericReference","abstract":"
If no characters match the range, then don’t consume any characters","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO16MissingSemicolonACSScACmF":{"name":"MissingSemicolon","abstract":"
[I]f the next character is a U+003B SEMICOLON, consume that too.","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO24OutsideValidUnicodeRangeACSScACmF":{"name":"OutsideValidUnicodeRange","abstract":"
[I]f the number is in the range 0xD800 to 0xDFFF or is greater","parent_name":"ParseError"},"Enums/ParseError.html":{"name":"ParseError","abstract":"
Enums used to delineate the different kinds of parse errors"},"Enums.html":{"name":"Enums","abstract":"
"}}
\ No newline at end of file
+{"Extensions/String/HTMLEscapeOptions.html#/s:SS12HTMLEntitiesE17HTMLEscapeOptionsV18allowUnsafeSymbolsSbvpZ":{"name":"allowUnsafeSymbols","abstract":"
Specifies if all ASCII characters should be skipped when escaping text
Return string as HTML escaped by replacing non-ASCII and unsafe characters","parent_name":"String"},"Extensions/String.html#/s:SS12HTMLEntitiesE12htmlUnescape6strictSSSb_tKF":{"name":"htmlUnescape(strict:)","abstract":"
Return string as HTML unescaped by replacing HTML character references with their","parent_name":"String"},"Extensions/String.html#/s:SS12HTMLEntitiesE12htmlUnescapeSSyF":{"name":"htmlUnescape()","abstract":"
Return string as HTML unescaped by replacing HTML character references with their","parent_name":"String"},"Extensions/String.html":{"name":"String","abstract":"
This String extension provides utility functions to convert strings to their"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO26DeprecatedNumericReferenceyACSScACmF":{"name":"DeprecatedNumericReference(_:)","abstract":"
“If that number is one of the numbers in the first column of the following","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO26DisallowedNumericReferenceyACSScACmF":{"name":"DisallowedNumericReference(_:)","abstract":"
“[I]f the number is in the range 0x0001 to 0x0008, 0x000D to 0x001F, 0x007F","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO15IllegalArgumentyACSScACmF":{"name":"IllegalArgument(_:)","abstract":"
This should NEVER be hit in code execution. If this error is thrown, then","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO21InvalidNamedReferenceyACSScACmF":{"name":"InvalidNamedReference(_:)","abstract":"
“[I]f the characters after the U+0026 AMPERSAND character (&) consist of","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO25MalformedNumericReferenceyACSScACmF":{"name":"MalformedNumericReference(_:)","abstract":"
“If no characters match the range, then don’t consume any characters","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO16MissingSemicolonyACSScACmF":{"name":"MissingSemicolon(_:)","abstract":"
“[I]f the next character is a U+003B SEMICOLON, consume that too.","parent_name":"ParseError"},"Enums/ParseError.html#/s:12HTMLEntities10ParseErrorO24OutsideValidUnicodeRangeyACSScACmF":{"name":"OutsideValidUnicodeRange(_:)","abstract":"
“[I]f the number is in the range 0xD800 to 0xDFFF or is greater","parent_name":"ParseError"},"Enums/ParseError.html":{"name":"ParseError","abstract":"
Enums used to delineate the different kinds of parse errors"},"Enums.html":{"name":"Enumerations","abstract":"
The following enumerations are available globally.