├── .github
├── CONTRIBUTING.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .jazzy.yaml
├── .travis.yml
├── HTMLEntities-Carthage.xcodeproj
├── HTMLEntitiesTests_Info.plist
├── HTMLEntities_Info.plist
├── project.pbxproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── xcshareddata
│ └── xcschemes
│ ├── HTMLEntities.xcscheme
│ └── xcschememanagement.plist
├── HTMLEntities.podspec
├── Info.plist
├── LICENSE
├── Package.swift
├── README.md
├── Sources
└── HTMLEntities
│ ├── Constants.swift
│ ├── ParseError.swift
│ ├── String+HTMLEntities.swift
│ └── Utilities.swift
├── Tests
├── HTMLEntitiesTests
│ ├── HTMLEntitiesTests.swift
│ └── LinuxSafeguardTest.swift
└── LinuxMain.swift
└── docs
├── Enums.html
├── Enums
└── ParseError.html
├── Extensions.html
├── Extensions
├── String.html
└── String
│ └── HTMLEscapeOptions.html
├── css
├── highlight.css
└── jazzy.css
├── docsets
├── HTMLEntities.docset
│ └── Contents
│ │ ├── Info.plist
│ │ └── Resources
│ │ ├── Documents
│ │ ├── Enums.html
│ │ ├── Enums
│ │ │ └── ParseError.html
│ │ ├── Extensions.html
│ │ ├── Extensions
│ │ │ ├── String.html
│ │ │ └── String
│ │ │ │ └── HTMLEscapeOptions.html
│ │ ├── css
│ │ │ ├── highlight.css
│ │ │ └── jazzy.css
│ │ ├── img
│ │ │ ├── carat.png
│ │ │ ├── dash.png
│ │ │ ├── gh.png
│ │ │ └── spinner.gif
│ │ ├── index.html
│ │ ├── js
│ │ │ ├── jazzy.js
│ │ │ ├── jazzy.search.js
│ │ │ ├── jquery.min.js
│ │ │ ├── lunr.min.js
│ │ │ └── typeahead.jquery.js
│ │ └── search.json
│ │ └── docSet.dsidx
└── HTMLEntities.tgz
├── img
├── carat.png
├── dash.png
├── gh.png
└── spinner.gif
├── index.html
├── js
├── jazzy.js
├── jazzy.search.js
├── jquery.min.js
├── lunr.min.js
└── typeahead.jquery.js
└── search.json
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to IBM-Swift
2 |
3 | We welcome contributions, and request you follow these guidelines.
4 |
5 | - [Raising issues](#raising-issues)
6 | - [Contributor License Agreement](#contributor-license-agreement)
7 | - [Coding Standards](#coding-standards)
8 |
9 |
10 | ## Raising issues
11 |
12 | Please raise any bug reports on the issue tracker. Be sure to
13 | search the list to see if your issue has already been raised.
14 |
15 | A good bug report is one that make it easy for us to understand what you were
16 | trying to do and what went wrong. Provide as much context as possible so we can try to recreate the issue.
17 |
18 | ### Contributor License Agreement
19 |
20 | In order for us to accept pull-requests, the contributor must first complete
21 | a Contributor License Agreement (CLA). Please see our [CLA repo](http://github.com/IBM-Swift/CLA) for more information.
22 |
23 | This clarifies the intellectual property license granted with any contribution. It is for your protection as a
24 | Contributor as well as the protection of IBM and its customers; it does not
25 | change your rights to use your own Contributions for any other purpose.
26 |
27 | ### Coding standards
28 |
29 | Please ensure you follow [the Kitura coding standards](https://github.com/IBM-Swift/Kitura/blob/master/Documentation/CodeConventions.md)
30 |
31 | Please note:
32 |
33 | - all files must have the Apache license in the header.
34 | - all PRs must have passing builds for all operating systems.
35 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Description
4 |
5 |
6 | ## Motivation and Context
7 |
8 |
9 |
10 | ## How Has This Been Tested?
11 |
12 |
13 |
14 |
15 | ## Checklist:
16 |
17 |
18 | - [ ] I have submitted a [CLA form](https://github.com/IBM-Swift/CLA)
19 | - [ ] If applicable, I have updated the documentation accordingly.
20 | - [ ] If applicable, I have added tests to cover my changes.
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 | *.xcodeproj/
5 | !HTMLEntities-Carthage.xcodeproj/
6 |
7 | ## Build generated
8 | build/
9 | DerivedData/
10 |
11 | ## Various settings
12 | *.pbxuser
13 | !default.pbxuser
14 | *.mode1v3
15 | !default.mode1v3
16 | *.mode2v3
17 | !default.mode2v3
18 | *.perspectivev3
19 | !default.perspectivev3
20 | xcuserdata/
21 |
22 | ## Other
23 | *.moved-aside
24 | *.xcuserstate
25 |
26 | ## Obj-C/Swift specific
27 | *.hmap
28 | *.ipa
29 | *.dSYM.zip
30 | *.dSYM
31 |
32 | ## Playgrounds
33 | timeline.xctimeline
34 | playground.xcworkspace
35 |
36 | # Swift Package Manager
37 | #
38 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
39 | # Packages/
40 | .build/
41 |
42 | # CocoaPods
43 | #
44 | # We recommend against adding the Pods directory to your .gitignore. However
45 | # you should judge for yourself, the pros and cons are mentioned at:
46 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
47 | #
48 | # Pods/
49 |
50 | # Carthage
51 | #
52 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
53 | # Carthage/Checkouts
54 |
55 | Carthage/Build
56 |
57 | # fastlane
58 | #
59 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
60 | # screenshots whenever they are needed.
61 | # For more information about the recommended setup visit:
62 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
63 |
64 | fastlane/report.xml
65 | fastlane/Preview.html
66 | fastlane/screenshots
67 | fastlane/test_output
68 |
--------------------------------------------------------------------------------
/.jazzy.yaml:
--------------------------------------------------------------------------------
1 | module: HTMLEntities
2 | author: IBM and the Kitura project authors
3 | github_url: https://github.com/Kitura/swift-html-entities
4 |
5 | theme: fullwidth
6 | clean: true
7 | exclude: [Packages]
8 |
9 | readme: README.md
10 |
11 | skip_undocumented: false
12 | hide_documentation_coverage: false
13 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # Travis CI build file.
2 |
3 | # whitelist (branches that should be built)
4 | branches:
5 | only:
6 | - master
7 | - /^issue.*$/
8 |
9 | # the matrix of builds should cover each combination of Swift version
10 | # and platform that is supported. The version of Swift used is specified
11 | # by .swift-version, unless SWIFT_SNAPSHOT is specified.
12 | matrix:
13 | include:
14 | - os: linux
15 | dist: xenial
16 | sudo: required
17 | services: docker
18 | env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu18.04:5.2.5
19 | - os: linux
20 | dist: bionic
21 | sudo: required
22 | services: docker
23 | env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu18.04:5.4
24 | - os: linux
25 | dist: xenial
26 | sudo: required
27 | services: docker
28 | env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu18.04:latest USE_SWIFT_DEVELOPMENT_SNAPSHOT=1
29 | - os: osx
30 | osx_image: xcode12.2
31 | sudo: required
32 | env: JAZZY_ELIGIBLE=true
33 | - os: osx
34 | osx_image: xcode13.2
35 | sudo: required
36 | env: USE_SWIFT_DEVELOPMENT_SNAPSHOT=1
37 |
38 |
39 | before_install:
40 | - git clone https://github.com/Kitura/Package-Builder.git
41 |
42 | script:
43 | - ./Package-Builder/build-package.sh -projectDir $TRAVIS_BUILD_DIR
44 |
--------------------------------------------------------------------------------
/HTMLEntities-Carthage.xcodeproj/HTMLEntitiesTests_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | BNDL
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/HTMLEntities-Carthage.xcodeproj/HTMLEntities_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/HTMLEntities-Carthage.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | OBJ_26 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_9 /* Constants.swift */; };
11 | OBJ_27 /* ParseError.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_10 /* ParseError.swift */; };
12 | OBJ_28 /* String+HTMLEntities.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_11 /* String+HTMLEntities.swift */; };
13 | OBJ_29 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_12 /* Utilities.swift */; };
14 | OBJ_36 /* HTMLEntitiesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_15 /* HTMLEntitiesTests.swift */; };
15 | OBJ_37 /* LinuxSafeguardTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_16 /* LinuxSafeguardTest.swift */; };
16 | OBJ_39 /* HTMLEntities.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_19 /* HTMLEntities.framework */; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXContainerItemProxy section */
20 | DFDE62571F59F33A00735E5F /* PBXContainerItemProxy */ = {
21 | isa = PBXContainerItemProxy;
22 | containerPortal = OBJ_1 /* Project object */;
23 | proxyType = 1;
24 | remoteGlobalIDString = OBJ_21;
25 | remoteInfo = HTMLEntities;
26 | };
27 | /* End PBXContainerItemProxy section */
28 |
29 | /* Begin PBXFileReference section */
30 | D8835F911F69ABA100694AD9 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
31 | OBJ_10 /* ParseError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseError.swift; sourceTree = ""; };
32 | OBJ_11 /* String+HTMLEntities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+HTMLEntities.swift"; sourceTree = ""; };
33 | OBJ_12 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = ""; };
34 | OBJ_15 /* HTMLEntitiesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTMLEntitiesTests.swift; sourceTree = ""; };
35 | OBJ_16 /* LinuxSafeguardTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinuxSafeguardTest.swift; sourceTree = ""; };
36 | OBJ_17 /* docs */ = {isa = PBXFileReference; lastKnownFileType = folder; path = docs; sourceTree = SOURCE_ROOT; };
37 | OBJ_19 /* HTMLEntities.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = HTMLEntities.framework; sourceTree = BUILT_PRODUCTS_DIR; };
38 | OBJ_20 /* HTMLEntitiesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; path = HTMLEntitiesTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
39 | OBJ_6 /* Package.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; };
40 | OBJ_9 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; };
41 | /* End PBXFileReference section */
42 |
43 | /* Begin PBXFrameworksBuildPhase section */
44 | OBJ_30 /* Frameworks */ = {
45 | isa = PBXFrameworksBuildPhase;
46 | buildActionMask = 0;
47 | files = (
48 | );
49 | runOnlyForDeploymentPostprocessing = 0;
50 | };
51 | OBJ_38 /* Frameworks */ = {
52 | isa = PBXFrameworksBuildPhase;
53 | buildActionMask = 0;
54 | files = (
55 | OBJ_39 /* HTMLEntities.framework in Frameworks */,
56 | );
57 | runOnlyForDeploymentPostprocessing = 0;
58 | };
59 | /* End PBXFrameworksBuildPhase section */
60 |
61 | /* Begin PBXGroup section */
62 | D8835F921F69ABD800694AD9 /* Supporting Files */ = {
63 | isa = PBXGroup;
64 | children = (
65 | D8835F911F69ABA100694AD9 /* Info.plist */,
66 | );
67 | name = "Supporting Files";
68 | sourceTree = "";
69 | };
70 | OBJ_13 /* Tests */ = {
71 | isa = PBXGroup;
72 | children = (
73 | OBJ_14 /* HTMLEntitiesTests */,
74 | );
75 | name = Tests;
76 | sourceTree = SOURCE_ROOT;
77 | };
78 | OBJ_14 /* HTMLEntitiesTests */ = {
79 | isa = PBXGroup;
80 | children = (
81 | OBJ_15 /* HTMLEntitiesTests.swift */,
82 | OBJ_16 /* LinuxSafeguardTest.swift */,
83 | );
84 | name = HTMLEntitiesTests;
85 | path = Tests/HTMLEntitiesTests;
86 | sourceTree = SOURCE_ROOT;
87 | };
88 | OBJ_18 /* Products */ = {
89 | isa = PBXGroup;
90 | children = (
91 | OBJ_19 /* HTMLEntities.framework */,
92 | OBJ_20 /* HTMLEntitiesTests.xctest */,
93 | );
94 | name = Products;
95 | sourceTree = BUILT_PRODUCTS_DIR;
96 | };
97 | OBJ_5 = {
98 | isa = PBXGroup;
99 | children = (
100 | OBJ_6 /* Package.swift */,
101 | OBJ_7 /* Sources */,
102 | OBJ_13 /* Tests */,
103 | D8835F921F69ABD800694AD9 /* Supporting Files */,
104 | OBJ_17 /* docs */,
105 | OBJ_18 /* Products */,
106 | );
107 | sourceTree = "";
108 | };
109 | OBJ_7 /* Sources */ = {
110 | isa = PBXGroup;
111 | children = (
112 | OBJ_8 /* HTMLEntities */,
113 | );
114 | name = Sources;
115 | sourceTree = SOURCE_ROOT;
116 | };
117 | OBJ_8 /* HTMLEntities */ = {
118 | isa = PBXGroup;
119 | children = (
120 | OBJ_9 /* Constants.swift */,
121 | OBJ_10 /* ParseError.swift */,
122 | OBJ_11 /* String+HTMLEntities.swift */,
123 | OBJ_12 /* Utilities.swift */,
124 | );
125 | name = HTMLEntities;
126 | path = Sources/HTMLEntities;
127 | sourceTree = SOURCE_ROOT;
128 | };
129 | /* End PBXGroup section */
130 |
131 | /* Begin PBXNativeTarget section */
132 | OBJ_21 /* HTMLEntities */ = {
133 | isa = PBXNativeTarget;
134 | buildConfigurationList = OBJ_22 /* Build configuration list for PBXNativeTarget "HTMLEntities" */;
135 | buildPhases = (
136 | OBJ_25 /* Sources */,
137 | OBJ_30 /* Frameworks */,
138 | );
139 | buildRules = (
140 | );
141 | dependencies = (
142 | );
143 | name = HTMLEntities;
144 | productName = HTMLEntities;
145 | productReference = OBJ_19 /* HTMLEntities.framework */;
146 | productType = "com.apple.product-type.framework";
147 | };
148 | OBJ_31 /* HTMLEntitiesTests */ = {
149 | isa = PBXNativeTarget;
150 | buildConfigurationList = OBJ_32 /* Build configuration list for PBXNativeTarget "HTMLEntitiesTests" */;
151 | buildPhases = (
152 | OBJ_35 /* Sources */,
153 | OBJ_38 /* Frameworks */,
154 | );
155 | buildRules = (
156 | );
157 | dependencies = (
158 | OBJ_40 /* PBXTargetDependency */,
159 | );
160 | name = HTMLEntitiesTests;
161 | productName = HTMLEntitiesTests;
162 | productReference = OBJ_20 /* HTMLEntitiesTests.xctest */;
163 | productType = "com.apple.product-type.bundle.unit-test";
164 | };
165 | /* End PBXNativeTarget section */
166 |
167 | /* Begin PBXProject section */
168 | OBJ_1 /* Project object */ = {
169 | isa = PBXProject;
170 | attributes = {
171 | LastUpgradeCheck = 9999;
172 | };
173 | buildConfigurationList = OBJ_2 /* Build configuration list for PBXProject "HTMLEntities-Carthage" */;
174 | compatibilityVersion = "Xcode 3.2";
175 | developmentRegion = English;
176 | hasScannedForEncodings = 0;
177 | knownRegions = (
178 | en,
179 | );
180 | mainGroup = OBJ_5;
181 | productRefGroup = OBJ_18 /* Products */;
182 | projectDirPath = "";
183 | projectRoot = "";
184 | targets = (
185 | OBJ_21 /* HTMLEntities */,
186 | OBJ_31 /* HTMLEntitiesTests */,
187 | );
188 | };
189 | /* End PBXProject section */
190 |
191 | /* Begin PBXSourcesBuildPhase section */
192 | OBJ_25 /* Sources */ = {
193 | isa = PBXSourcesBuildPhase;
194 | buildActionMask = 0;
195 | files = (
196 | OBJ_26 /* Constants.swift in Sources */,
197 | OBJ_27 /* ParseError.swift in Sources */,
198 | OBJ_28 /* String+HTMLEntities.swift in Sources */,
199 | OBJ_29 /* Utilities.swift in Sources */,
200 | );
201 | runOnlyForDeploymentPostprocessing = 0;
202 | };
203 | OBJ_35 /* Sources */ = {
204 | isa = PBXSourcesBuildPhase;
205 | buildActionMask = 0;
206 | files = (
207 | OBJ_36 /* HTMLEntitiesTests.swift in Sources */,
208 | OBJ_37 /* LinuxSafeguardTest.swift in Sources */,
209 | );
210 | runOnlyForDeploymentPostprocessing = 0;
211 | };
212 | /* End PBXSourcesBuildPhase section */
213 |
214 | /* Begin PBXTargetDependency section */
215 | OBJ_40 /* PBXTargetDependency */ = {
216 | isa = PBXTargetDependency;
217 | target = OBJ_21 /* HTMLEntities */;
218 | targetProxy = DFDE62571F59F33A00735E5F /* PBXContainerItemProxy */;
219 | };
220 | /* End PBXTargetDependency section */
221 |
222 | /* Begin XCBuildConfiguration section */
223 | OBJ_23 /* Debug */ = {
224 | isa = XCBuildConfiguration;
225 | buildSettings = {
226 | APPLICATION_EXTENSION_API_ONLY = YES;
227 | CURRENT_PROJECT_VERSION = 1;
228 | ENABLE_TESTABILITY = YES;
229 | FRAMEWORK_SEARCH_PATHS = (
230 | "$(inherited)",
231 | "$(PLATFORM_DIR)/Developer/Library/Frameworks",
232 | );
233 | HEADER_SEARCH_PATHS = "$(inherited)";
234 | INFOPLIST_FILE = "${PROJECT_FILE_PATH}/HTMLEntities_Info.plist";
235 | LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx";
236 | OTHER_LDFLAGS = "$(inherited)";
237 | OTHER_SWIFT_FLAGS = "$(inherited)";
238 | PRODUCT_BUNDLE_IDENTIFIER = HTMLEntities;
239 | PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
240 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
241 | SKIP_INSTALL = YES;
242 | TARGET_NAME = HTMLEntities;
243 | };
244 | name = Debug;
245 | };
246 | OBJ_24 /* Release */ = {
247 | isa = XCBuildConfiguration;
248 | buildSettings = {
249 | APPLICATION_EXTENSION_API_ONLY = YES;
250 | CURRENT_PROJECT_VERSION = 1;
251 | ENABLE_TESTABILITY = YES;
252 | FRAMEWORK_SEARCH_PATHS = (
253 | "$(inherited)",
254 | "$(PLATFORM_DIR)/Developer/Library/Frameworks",
255 | );
256 | HEADER_SEARCH_PATHS = "$(inherited)";
257 | INFOPLIST_FILE = "${PROJECT_FILE_PATH}/HTMLEntities_Info.plist";
258 | LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx";
259 | OTHER_LDFLAGS = "$(inherited)";
260 | OTHER_SWIFT_FLAGS = "$(inherited)";
261 | PRODUCT_BUNDLE_IDENTIFIER = HTMLEntities;
262 | PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
263 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
264 | SKIP_INSTALL = YES;
265 | TARGET_NAME = HTMLEntities;
266 | };
267 | name = Release;
268 | };
269 | OBJ_3 /* Debug */ = {
270 | isa = XCBuildConfiguration;
271 | buildSettings = {
272 | CLANG_ENABLE_OBJC_ARC = YES;
273 | COMBINE_HIDPI_IMAGES = YES;
274 | COPY_PHASE_STRIP = NO;
275 | CURRENT_PROJECT_VERSION = 1;
276 | DEBUG_INFORMATION_FORMAT = dwarf;
277 | DYLIB_INSTALL_NAME_BASE = "@rpath";
278 | ENABLE_NS_ASSERTIONS = YES;
279 | GCC_OPTIMIZATION_LEVEL = 0;
280 | INFOPLIST_FILE = Info.plist;
281 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
282 | MACOSX_DEPLOYMENT_TARGET = 10.9;
283 | ONLY_ACTIVE_ARCH = YES;
284 | OTHER_SWIFT_FLAGS = "-DXcode";
285 | PRODUCT_NAME = "$(TARGET_NAME)";
286 | SDKROOT = macosx;
287 | SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator";
288 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE;
289 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
290 | SWIFT_VERSION = 4.2;
291 | TVOS_DEPLOYMENT_TARGET = 9.0;
292 | USE_HEADERMAP = NO;
293 | WATCHOS_DEPLOYMENT_TARGET = 2.0;
294 | };
295 | name = Debug;
296 | };
297 | OBJ_33 /* Debug */ = {
298 | isa = XCBuildConfiguration;
299 | buildSettings = {
300 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
301 | FRAMEWORK_SEARCH_PATHS = (
302 | "$(inherited)",
303 | "$(PLATFORM_DIR)/Developer/Library/Frameworks",
304 | );
305 | HEADER_SEARCH_PATHS = "$(inherited)";
306 | INFOPLIST_FILE = "${PROJECT_FILE_PATH}/HTMLEntitiesTests_Info.plist";
307 | LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @loader_path/Frameworks";
308 | OTHER_LDFLAGS = "$(inherited)";
309 | OTHER_SWIFT_FLAGS = "$(inherited)";
310 | TARGET_NAME = HTMLEntitiesTests;
311 | };
312 | name = Debug;
313 | };
314 | OBJ_34 /* Release */ = {
315 | isa = XCBuildConfiguration;
316 | buildSettings = {
317 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
318 | FRAMEWORK_SEARCH_PATHS = (
319 | "$(inherited)",
320 | "$(PLATFORM_DIR)/Developer/Library/Frameworks",
321 | );
322 | HEADER_SEARCH_PATHS = "$(inherited)";
323 | INFOPLIST_FILE = "${PROJECT_FILE_PATH}/HTMLEntitiesTests_Info.plist";
324 | LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @loader_path/Frameworks";
325 | OTHER_LDFLAGS = "$(inherited)";
326 | OTHER_SWIFT_FLAGS = "$(inherited)";
327 | TARGET_NAME = HTMLEntitiesTests;
328 | };
329 | name = Release;
330 | };
331 | OBJ_4 /* Release */ = {
332 | isa = XCBuildConfiguration;
333 | buildSettings = {
334 | CLANG_ENABLE_OBJC_ARC = YES;
335 | COMBINE_HIDPI_IMAGES = YES;
336 | COPY_PHASE_STRIP = YES;
337 | CURRENT_PROJECT_VERSION = 1;
338 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
339 | DYLIB_INSTALL_NAME_BASE = "@rpath";
340 | GCC_OPTIMIZATION_LEVEL = s;
341 | INFOPLIST_FILE = Info.plist;
342 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
343 | MACOSX_DEPLOYMENT_TARGET = 10.9;
344 | OTHER_SWIFT_FLAGS = "-DXcode";
345 | PRODUCT_NAME = "$(TARGET_NAME)";
346 | SDKROOT = macosx;
347 | SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator";
348 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE;
349 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
350 | SWIFT_VERSION = 4.2;
351 | TVOS_DEPLOYMENT_TARGET = 9.0;
352 | USE_HEADERMAP = NO;
353 | WATCHOS_DEPLOYMENT_TARGET = 2.0;
354 | };
355 | name = Release;
356 | };
357 | /* End XCBuildConfiguration section */
358 |
359 | /* Begin XCConfigurationList section */
360 | OBJ_2 /* Build configuration list for PBXProject "HTMLEntities-Carthage" */ = {
361 | isa = XCConfigurationList;
362 | buildConfigurations = (
363 | OBJ_3 /* Debug */,
364 | OBJ_4 /* Release */,
365 | );
366 | defaultConfigurationIsVisible = 0;
367 | defaultConfigurationName = Debug;
368 | };
369 | OBJ_22 /* Build configuration list for PBXNativeTarget "HTMLEntities" */ = {
370 | isa = XCConfigurationList;
371 | buildConfigurations = (
372 | OBJ_23 /* Debug */,
373 | OBJ_24 /* Release */,
374 | );
375 | defaultConfigurationIsVisible = 0;
376 | defaultConfigurationName = Debug;
377 | };
378 | OBJ_32 /* Build configuration list for PBXNativeTarget "HTMLEntitiesTests" */ = {
379 | isa = XCConfigurationList;
380 | buildConfigurations = (
381 | OBJ_33 /* Debug */,
382 | OBJ_34 /* Release */,
383 | );
384 | defaultConfigurationIsVisible = 0;
385 | defaultConfigurationName = Debug;
386 | };
387 | /* End XCConfigurationList section */
388 | };
389 | rootObject = OBJ_1 /* Project object */;
390 | }
391 |
--------------------------------------------------------------------------------
/HTMLEntities-Carthage.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/HTMLEntities-Carthage.xcodeproj/xcshareddata/xcschemes/HTMLEntities.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
55 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
74 |
76 |
77 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/HTMLEntities-Carthage.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SchemeUserState
5 |
6 | HTMLEntities.xcscheme
7 |
8 |
9 | SuppressBuildableAutocreation
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/HTMLEntities.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod spec lint HTMLEntities.podspec' to ensure this is a
3 | # valid spec and to remove all comments including this before submitting the spec.
4 | #
5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
7 | #
8 |
9 | Pod::Spec.new do |s|
10 |
11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
12 | #
13 | # These will help people to find your library, and whilst it
14 | # can feel like a chore to fill in it's definitely to your advantage. The
15 | # summary should be tweet-length, and the description more in depth.
16 | #
17 |
18 | s.name = "HTMLEntities"
19 | s.version = "4.0.1"
20 | s.summary = "HTML5 spec-compliant character encoder/decoder for Swift"
21 |
22 | # This description is used to generate tags and improve search results.
23 | # * Think: What does it do? Why did you write it? What is the focus?
24 | # * Try to keep it short, snappy and to the point.
25 | # * Write the description between the DESC delimiters below.
26 | # * Finally, don't worry about the indent, CocoaPods strips it!
27 | s.description = <<-DESC
28 | Pure Swift HTML encode/decode utility tool for Swift 4 and Swift 5.
29 |
30 | Includes support for HTML5 named character references. You can find the list of all 2231 HTML5 named character references [here](https://www.w3.org/TR/html5/syntax.html#named-character-references).
31 |
32 | `HTMLEntities` can escape ALL non-ASCII characters as well as the characters `<`, `>`, `&`, `"`, `’`, as these five characters are part of the HTML tag and HTML attribute syntaxes.
33 |
34 | In addition, `HTMLEntities` can unescape encoded HTML text that contains decimal, hexadecimal, or HTML5 named character references.
35 | DESC
36 |
37 | s.homepage = "https://github.com/Kitura/swift-html-entities"
38 | # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
39 |
40 |
41 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
42 | #
43 | # Licensing your code is important. See http://choosealicense.com for more info.
44 | # CocoaPods will detect a license file if there is a named LICENSE*
45 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'.
46 | #
47 |
48 | s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }
49 | # s.license = { :type => "MIT", :file => "FILE_LICENSE" }
50 |
51 |
52 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
53 | #
54 | # Specify the authors of the library, with email addresses. Email addresses
55 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
56 | # accepts just a name if you'd rather not provide an email address.
57 | #
58 | # Specify a social_media_url where others can refer to, for example a twitter
59 | # profile URL.
60 | #
61 |
62 | s.author = "Youming Lin"
63 |
64 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
65 | #
66 | # If this Pod runs only on iOS or OS X, then specify the platform and
67 | # the deployment target. You can optionally include the target after the platform.
68 | #
69 |
70 | # s.platform = :ios
71 | # s.platform = :ios, "5.0"
72 |
73 | # When using multiple platforms
74 | s.ios.deployment_target = "9.0"
75 | s.osx.deployment_target = "10.10"
76 | # s.watchos.deployment_target = "2.0"
77 | # s.tvos.deployment_target = "9.0"
78 | s.swift_version = "5.2"
79 |
80 |
81 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
82 | #
83 | # Specify the location from where the source should be retrieved.
84 | # Supports git, hg, bzr, svn and HTTP.
85 | #
86 |
87 | s.source = { :git => "https://github.com/Kitura/swift-html-entities.git", :tag => "#{s.version}" }
88 |
89 |
90 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
91 | #
92 | # CocoaPods is smart about how it includes source code. For source files
93 | # giving a folder will include any swift, h, m, mm, c & cpp files.
94 | # For header files it will include any header in the folder.
95 | # Not including the public_header_files will make all headers public.
96 | #
97 |
98 | s.source_files = "Sources/**/*.swift"
99 | # s.exclude_files = "Classes/Exclude"
100 |
101 | # s.public_header_files = "Classes/**/*.h"
102 |
103 |
104 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
105 | #
106 | # A list of resources included with the Pod. These are copied into the
107 | # target bundle with a build phase script. Anything else will be cleaned.
108 | # You can preserve files from being cleaned, please don't preserve
109 | # non-essential files like tests, examples and documentation.
110 | #
111 |
112 | # s.resource = "icon.png"
113 | # s.resources = "Resources/*.png"
114 |
115 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave"
116 |
117 |
118 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
119 | #
120 | # Link your library with frameworks, or libraries. Libraries do not include
121 | # the lib prefix of their name.
122 | #
123 |
124 | # s.framework = "SomeFramework"
125 | # s.frameworks = "SomeFramework", "AnotherFramework"
126 |
127 | # s.library = "iconv"
128 | # s.libraries = "iconv", "xml2"
129 |
130 |
131 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
132 | #
133 | # If your library depends on compiler flags you can set them in the xcconfig hash
134 | # where they will only apply to your library. If you depend on other Podspecs
135 | # you can include multiple dependencies to ensure it works.
136 |
137 | # s.requires_arc = true
138 |
139 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
140 | # s.dependency "JSONKit", "~> 1.4"
141 |
142 | end
143 |
--------------------------------------------------------------------------------
/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleVersion
6 | $(CURRENT_PROJECT_VERSION)
7 |
8 |
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.2
2 | // The swift-tools-version declares the minimum version of Swift required to build this package.
3 |
4 | /**
5 | * Copyright IBM Corporation and the Kitura project authors 2016-2020
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | **/
19 |
20 | import PackageDescription
21 |
22 | let package = Package(
23 | name: "HTMLEntities",
24 | products: [
25 | // Products define the executables and libraries produced by a package, and make them visible to other packages.
26 | .library(
27 | name: "HTMLEntities",
28 | targets: ["HTMLEntities"]
29 | )
30 | ],
31 | targets: [
32 | // Targets are the basic building blocks of a package. A target can define a module or a test suite.
33 | // Targets can depend on other targets in this package, and on products in packages which this package depends on.
34 | .target(
35 | name: "HTMLEntities"
36 | ),
37 | .testTarget(
38 | name: "HTMLEntitiesTests",
39 | dependencies: ["HTMLEntities"]
40 | )
41 | ]
42 | )
43 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # HTMLEntities
2 |
3 | [](https://travis-ci.org/Kitura/swift-html-entities)
4 | 
5 | 
6 | 
7 | [](https://codecov.io/gh/Kitura/swift-html-entities)
8 | [](https://github.com/Carthage/Carthage)
9 |
10 | ## Summary
11 | Pure Swift HTML encode/decode utility tool for Swift.
12 |
13 | Includes support for HTML5 named character references. You can find the list of all 2231 HTML5 named character references [here](https://www.w3.org/TR/html5/syntax.html#named-character-references).
14 |
15 | `HTMLEntities` can escape ALL non-ASCII characters as well as the characters `<`, `>`, `&`, `"`, `’`, as these five characters are part of the HTML tag and HTML attribute syntaxes.
16 |
17 | In addition, `HTMLEntities` can unescape encoded HTML text that contains decimal, hexadecimal, or HTML5 named character references.
18 |
19 | ## API Documentation
20 |
21 | API documentation for `HTMLEntities` is located [here](https://kitura.github.io/swift-html-entities/).
22 |
23 | ## Features
24 |
25 | * Supports HTML5 named character references (`NegativeMediumSpace;` etc.)
26 | * HTML5 spec-compliant; strict parse mode recognizes [parse errors](https://www.w3.org/TR/html5/syntax.html#tokenizing-character-references)
27 | * Supports decimal and hexadecimal escapes for all characters
28 | * Simple to use as functions are added by way of extending the default `String` class
29 | * Minimal dependencies; implementation is completely self-contained
30 |
31 | ## Version Info
32 |
33 | Latest release of `HTMLEntities` requires Swift 4.0 and higher.
34 |
35 | ## Installation
36 |
37 | ### Via Swift Package Manager
38 |
39 | Add `HTMLEntities` to your `Package.swift`:
40 |
41 | ```swift
42 | import PackageDescription
43 |
44 | let package = Package(
45 | name: "",
46 | ...
47 | dependencies: [
48 | .package(url: "https://github.com/Kitura/swift-html-entities.git", from: "3.0.0")
49 | ]
50 | // Also, make sure to add HTMLEntities to your package target's dependencies
51 | )
52 | ```
53 |
54 | ### Via CocoaPods
55 |
56 | Add `HTMLEntities` to your `Podfile`:
57 |
58 | ```
59 | target '' do
60 | pod 'HTMLEntities', :git => 'https://github.com/Kitura/swift-html-entities.git'
61 | end
62 | ```
63 |
64 | ### Via Carthage
65 |
66 | Add `HTMLEntities` to your `Cartfile`:
67 |
68 | ```
69 | github "Kitura/swift-html-entities"
70 | ```
71 |
72 | ## Usage
73 |
74 | ```swift
75 | import HTMLEntities
76 |
77 | // encode example
78 | let html = ""
79 |
80 | print(html.htmlEscape())
81 | // Prints "<script>alert("abc")</script>"
82 |
83 | // decode example
84 | let htmlencoded = "<script>alert("abc")</script>"
85 |
86 | print(htmlencoded.htmlUnescape())
87 | // Prints ""
88 | ```
89 |
90 | ## Advanced Options
91 |
92 | `HTMLEntities` supports various options when escaping and unescaping HTML characters.
93 |
94 | ### Escape Options
95 |
96 | #### `allowUnsafeSymbols`
97 |
98 | Defaults to `false`. Specifies if unsafe ASCII characters should be skipped or not.
99 |
100 | ```swift
101 | import HTMLEntities
102 |
103 | let html = "
"
110 |
111 | ```
112 |
113 | #### `decimal`
114 |
115 | Defaults to `false`. Specifies if decimal character escapes should be used instead of hexadecimal character escapes whenever numeric character escape is used (i.e., does not affect named character references escapes). The use of hexadecimal character escapes is recommended.
116 |
117 | ```swift
118 | import HTMLEntities
119 |
120 | let text = "한, 한, ế, ế, 🇺🇸"
121 |
122 | print(text.htmlEscape())
123 | // Prints "한, 한, ế, ế, 🇺🇸"
124 |
125 | print(text.htmlEscape(decimal: true))
126 | // Prints "한, 한, ế, ế, 🇺🇸"
127 | ```
128 |
129 | #### `encodeEverything`
130 |
131 | Defaults to `false`. Specifies if all characters should be escaped, even if some characters are safe. If `true`, overrides the setting for `allowUnsafeSymbols`.
132 |
133 | ```swift
134 | import HTMLEntities
135 |
136 | let text = "A quick brown fox jumps over the lazy dog"
137 |
138 | print(text.htmlEscape())
139 | // Prints "A quick brown fox jumps over the lazy dog"
140 |
141 | print(text.htmlEscape(encodeEverything: true))
142 | // Prints "A quick brown fox jumps over the lazy dog"
143 |
144 | // `encodeEverything` overrides `allowUnsafeSymbols`
145 | print(text.htmlEscape(allowUnsafeSymbols: true, encodeEverything: true))
146 | // Prints "A quick brown fox jumps over the lazy dog"
147 | ```
148 |
149 | #### `useNamedReferences`
150 |
151 | Defaults to `false`. Specifies if named character references should be used whenever possible. Set to `false` to always use numeric character references, i.e., for compatibility with older browsers that do not recognize named character references.
152 |
153 | ```swift
154 | import HTMLEntities
155 |
156 | let html = ""
157 |
158 | print(html.htmlEscape())
159 | // Prints “<script>alert("abc")</script>”
160 |
161 | print(html.htmlEscape(useNamedReferences: true))
162 | // Prints “<script>alert("abc")</script>”
163 | ```
164 |
165 | #### Set Escape Options Globally
166 |
167 | 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.
168 |
169 | ```swift
170 | import HTMLEntities
171 |
172 | // set `useNamedReferences` to `true` globally
173 | String.HTMLEscapeOptions.useNamedReferences = true
174 |
175 | let html = ""
176 |
177 | // Now, the default behavior of `htmlEscape()` is to use named character references
178 | print(html.htmlEscape())
179 | // Prints “<script>alert("abc")</script>”
180 |
181 | // And you can still go back to using numeric character references only
182 | print(html.htmlEscape(useNamedReferences: false))
183 | // Prints "<script>alert("abc")</script>"
184 | ```
185 |
186 | ### Unescape Options
187 |
188 | #### `strict`
189 |
190 | Defaults to `false`. Specifies if HTML5 parse errors should be thrown or simply passed over.
191 |
192 | **Note**: `htmlUnescape()` is a throwing function if `strict` is used in call argument (no matter if it is set to `true` or `false`); `htmlUnescape()` is NOT a throwing function if no argument is provided.
193 |
194 | ```swift
195 | import HTMLEntities
196 |
197 | let text = "한"
198 |
199 | print(text.htmlUnescape())
200 | // Prints "한"
201 |
202 | print(try text.htmlUnescape(strict: true))
203 | // Throws a `ParseError.MissingSemicolon` instance
204 |
205 | // a throwing function because `strict` is passed in argument
206 | // but no error is thrown because `strict: false`
207 | print(try text.htmlUnescape(strict: false))
208 | // Prints "한"
209 | ```
210 |
211 | ## Acknowledgments
212 |
213 | `HTMLEntities` was designed to support some of the same options as [`he`](https://github.com/mathiasbynens/he), a popular Javascript HTML encoder/decoder.
214 |
215 | ## License
216 |
217 | Apache 2.0
218 |
--------------------------------------------------------------------------------
/Sources/HTMLEntities/ParseError.swift:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright IBM Corporation 2016, 2017
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /// Enums used to delineate the different kinds of parse errors
18 | /// that may be encountered during HTML unescaping. See
19 | /// https://www.w3.org/TR/html5/syntax.html#tokenizing-character-references
20 | /// for an explanation of the different parse errors.
21 | public enum ParseError: Error {
22 | /// "If that number is one of the numbers in the first column of the following
23 | /// table, then this is a parse error."
24 | case DeprecatedNumericReference(String)
25 |
26 | /// "[I]f the number is in the range 0x0001 to 0x0008, 0x000D to 0x001F, 0x007F
27 | /// to 0x009F, 0xFDD0 to 0xFDEF, or is one of 0x000B, 0xFFFE, 0xFFFF, 0x1FFFE,
28 | /// 0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE, 0x3FFFF, 0x4FFFE, 0x4FFFF, 0x5FFFE,
29 | /// 0x5FFFF, 0x6FFFE, 0x6FFFF, 0x7FFFE, 0x7FFFF, 0x8FFFE, 0x8FFFF, 0x9FFFE,
30 | /// 0x9FFFF, 0xAFFFE, 0xAFFFF, 0xBFFFE, 0xBFFFF, 0xCFFFE, 0xCFFFF, 0xDFFFE,
31 | /// 0xDFFFF, 0xEFFFE, 0xEFFFF, 0xFFFFE, 0xFFFFF, 0x10FFFE, or 0x10FFFF, then
32 | /// this is a parse error."
33 | case DisallowedNumericReference(String)
34 |
35 | /// This should NEVER be hit in code execution. If this error is thrown, then
36 | /// decoder has faulty logic
37 | case IllegalArgument(String)
38 |
39 | /// "[I]f the characters after the U+0026 AMPERSAND character (&) consist of
40 | /// a sequence of one or more alphanumeric ASCII characters followed by a
41 | /// U+003B SEMICOLON character (;), then this is a parse error."
42 | case InvalidNamedReference(String)
43 |
44 | /// "If no characters match the range, then don't consume any characters
45 | /// (and unconsume the U+0023 NUMBER SIGN character and, if appropriate,
46 | /// the X character). This is a parse error; nothing is returned."
47 | case MalformedNumericReference(String)
48 |
49 | /// "[I]f the next character is a U+003B SEMICOLON, consume that too.
50 | /// If it isn't, there is a parse error."
51 | case MissingSemicolon(String)
52 |
53 | /// "[I]f the number is in the range 0xD800 to 0xDFFF or is greater
54 | /// than 0x10FFFF, then this is a parse error."
55 | case OutsideValidUnicodeRange(String)
56 | }
57 |
--------------------------------------------------------------------------------
/Sources/HTMLEntities/Utilities.swift:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright IBM Corporation 2016, 2017
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | extension Dictionary {
18 | /// Union of two dictionaries
19 | /// Note: The in the argument will override
20 | /// the current dictionary's if the keys match
21 | func updating(_ dict: [Key: Value]) -> [Key: Value] {
22 | var newDict = self
23 |
24 | for (key, value) in dict {
25 | newDict[key] = value
26 | }
27 |
28 | return newDict
29 | }
30 | }
31 |
32 | extension Dictionary where Value: Hashable {
33 | /// Invert a dictionary: ->
34 | /// Note: Does not check for uniqueness among values
35 | func inverting(_ pick: (Key, Key) -> Key = { existingValue, newValue in
36 | return newValue
37 | }) -> [Value: Key] {
38 | var inverseDict: [Value: Key] = [:]
39 |
40 | for (key, value) in self {
41 | if let existing = inverseDict[value] {
42 | inverseDict[value] = pick(existing, key)
43 | }
44 | else {
45 | inverseDict[value] = key
46 | }
47 | }
48 |
49 | return inverseDict
50 | }
51 | }
52 |
53 | extension UInt32 {
54 | var isAlphaNumeric: Bool {
55 | // unicode values of [0-9], [A-Z], and [a-z]
56 | return self.isNumeral || 0x41...0x5A ~= self || 0x61...0x7A ~= self
57 | }
58 |
59 | var isAmpersand: Bool {
60 | // unicode value of &
61 | return self == 0x26
62 | }
63 |
64 | var isASCII: Bool {
65 | // Less than 0x80
66 | return self < 0x80
67 | }
68 |
69 | /// https://www.w3.org/International/questions/qa-escapes#use
70 | var isAttributeSyntax: Bool {
71 | // unicode values of [", ']
72 | return self == 0x22 || self == 0x27
73 | }
74 |
75 | var isDisallowedReference: Bool {
76 | // unicode values of [0x1-0x8], [0xD-0x1F], [0x7F-0x9F], [0xFDD0-0xFDEF],
77 | // 0xB, 0xFFFE, 0xFFFF, 0x1FFFE, 0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE, 0x3FFFF,
78 | // 0x4FFFE, 0x4FFFF, 0x5FFFE, 0x5FFFF, 0x6FFFE, 0x6FFFF, 0x7FFFE, 0x7FFFF,
79 | // 0x8FFFE, 0x8FFFF, 0x9FFFE, 0x9FFFF, 0xAFFFE, 0xAFFFF, 0xBFFFE, 0xBFFFF,
80 | // 0xCFFFE, 0xCFFFF, 0xDFFFE, 0xDFFFF, 0xEFFFE, 0xEFFFF, 0xFFFFE, 0xFFFFF,
81 | // 0x10FFFE, and 0x10FFFF
82 | return disallowedNumericReferences.contains(self)
83 | }
84 |
85 | var isHash: Bool {
86 | // unicode value of #
87 | return self == 0x23
88 | }
89 |
90 | var isHexNumeral: Bool {
91 | // unicode values of [0-9], [A-F], and [a-f]
92 | return isNumeral || 0x41...0x46 ~= self || 0x61...0x66 ~= self
93 | }
94 |
95 | var isNumeral: Bool {
96 | // unicode values of [0-9]
97 | return 0x30...0x39 ~= self
98 | }
99 |
100 | /// https://www.w3.org/TR/html5/syntax.html#tokenizing-character-references
101 | var isReplacementCharacterEquivalent: Bool {
102 | // UInt32 values of [0xD800-0xDFFF], (0x10FFFF-∞]
103 | return 0xD800...0xDFFF ~= self || 0x10FFFF < self
104 | }
105 |
106 | var isSafeASCII: Bool {
107 | return self.isASCII && !self.isAttributeSyntax && !self.isTagSyntax
108 | }
109 |
110 | var isSemicolon: Bool {
111 | // unicode value of ;
112 | return self == 0x3B
113 | }
114 |
115 | /// https://www.w3.org/International/questions/qa-escapes#use
116 | var isTagSyntax: Bool {
117 | // unicode values of [&, < , >]
118 | return self.isAmpersand || self == 0x3C || self == 0x3E
119 | }
120 |
121 | var isX: Bool {
122 | // unicode values of X and x
123 | return self == 0x58 || self == 0x78
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/Tests/HTMLEntitiesTests/LinuxSafeguardTest.swift:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright IBM Corporation 2017
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | // An extra test case to ensure that all other test cases include all of their
18 | // tests in their respective `allTests` variable. This is to ensure that the
19 | // same number of unit tests are executed on Linux as there are on OSX.
20 | //
21 | // Code adapted from https://oleb.net/blog/2017/03/keeping-xctest-in-sync/
22 |
23 | // Test disabled on Swift 4 for now due to
24 | // https://bugs.swift.org/browse/SR-5684
25 | #if os(OSX) && !swift(>=3.2)
26 | import XCTest
27 |
28 | class LinuxSafeguardTest: XCTestCase {
29 | func testLinuxTestSuiteIncludesAllTests() {
30 | var linuxCount: Int
31 | var darwinCount: Int
32 |
33 | // HTMLEntitiesTests
34 | linuxCount = HTMLEntitiesTests.allTests.count
35 | darwinCount = Int(HTMLEntitiesTests.defaultTestSuite().testCaseCount)
36 | XCTAssertEqual(linuxCount, darwinCount, "\(darwinCount - linuxCount) tests are missing from HTMLEntitiesTests.allTests")
37 | }
38 | }
39 | #endif
40 |
--------------------------------------------------------------------------------
/Tests/LinuxMain.swift:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright IBM Corporation 2017
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | **/
16 |
17 | import Glibc
18 | import XCTest
19 | @testable import HTMLEntitiesTests
20 |
21 | // Implementation taken from http://stackoverflow.com/a/24029847
22 | #if swift(>=3.2)
23 | extension MutableCollection {
24 | mutating func shuffle() {
25 | let c = count
26 | guard c > 1 else { return }
27 |
28 | srand(UInt32(time(nil)))
29 | for (firstUnshuffled , unshuffledCount) in zip(indices, stride(from: c, to: 1, by: -1)) {
30 | let d: IndexDistance = numericCast(random() % numericCast(unshuffledCount))
31 | guard d != 0 else { continue }
32 | let i = index(firstUnshuffled, offsetBy: d)
33 | swapAt(firstUnshuffled, i)
34 | }
35 | }
36 | }
37 | #else
38 | extension MutableCollection where Indices.Iterator.Element == Index {
39 | mutating func shuffle() {
40 | let c = count
41 | guard c > 1 else { return }
42 |
43 | srand(UInt32(time(nil)))
44 | for (firstUnshuffled , unshuffledCount) in zip(indices, stride(from: c, to: 1, by: -1)) {
45 | let d: IndexDistance = numericCast(random() % numericCast(unshuffledCount))
46 | guard d != 0 else { continue }
47 | let i = index(firstUnshuffled, offsetBy: d)
48 | swap(&self[firstUnshuffled], &self[i])
49 | }
50 | }
51 | }
52 | #endif
53 |
54 | extension Sequence {
55 | func shuffled() -> [Iterator.Element] {
56 | var result = Array(self)
57 | result.shuffle()
58 | return result
59 | }
60 | }
61 |
62 | XCTMain([
63 | testCase(HTMLEntitiesTests.allTests.shuffled()),
64 | ].shuffled())
65 |
--------------------------------------------------------------------------------
/docs/Enums.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Enumerations Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
“[I]f the number is in the range 0x0001 to 0x0008, 0x000D to 0x001F, 0x007F
140 | to 0x009F, 0xFDD0 to 0xFDEF, or is one of 0x000B, 0xFFFE, 0xFFFF, 0x1FFFE,
141 | 0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE, 0x3FFFF, 0x4FFFE, 0x4FFFF, 0x5FFFE,
142 | 0x5FFFF, 0x6FFFE, 0x6FFFF, 0x7FFFE, 0x7FFFF, 0x8FFFE, 0x8FFFF, 0x9FFFE,
143 | 0x9FFFF, 0xAFFFE, 0xAFFFF, 0xBFFFE, 0xBFFFF, 0xCFFFE, 0xCFFFF, 0xDFFFE,
144 | 0xDFFFF, 0xEFFFE, 0xEFFFF, 0xFFFFE, 0xFFFFF, 0x10FFFE, or 0x10FFFF, then
145 | this is a parse error.”
“[I]f the characters after the U+0026 AMPERSAND character (&) consist of
201 | a sequence of one or more alphanumeric ASCII characters followed by a
202 | U+003B SEMICOLON character (;), then this is a parse error.”
“If no characters match the range, then don’t consume any characters
230 | (and unconsume the U+0023 NUMBER SIGN character and, if appropriate,
231 | the X character). This is a parse error; nothing is returned.”
Return string as HTML escaped by replacing non-ASCII and unsafe characters
138 | with their numeric character escapes, or if such exists, their HTML named
139 | character reference equivalents. For example, this function turns
Return string as HTML unescaped by replacing HTML character references with their
238 | unicode character equivalents. For example, this function turns
Return string as HTML unescaped by replacing HTML character references with their
296 | unicode character equivalents. For example, this function turns
“[I]f the number is in the range 0x0001 to 0x0008, 0x000D to 0x001F, 0x007F
140 | to 0x009F, 0xFDD0 to 0xFDEF, or is one of 0x000B, 0xFFFE, 0xFFFF, 0x1FFFE,
141 | 0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE, 0x3FFFF, 0x4FFFE, 0x4FFFF, 0x5FFFE,
142 | 0x5FFFF, 0x6FFFE, 0x6FFFF, 0x7FFFE, 0x7FFFF, 0x8FFFE, 0x8FFFF, 0x9FFFE,
143 | 0x9FFFF, 0xAFFFE, 0xAFFFF, 0xBFFFE, 0xBFFFF, 0xCFFFE, 0xCFFFF, 0xDFFFE,
144 | 0xDFFFF, 0xEFFFE, 0xEFFFF, 0xFFFFE, 0xFFFFF, 0x10FFFE, or 0x10FFFF, then
145 | this is a parse error.”
“[I]f the characters after the U+0026 AMPERSAND character (&) consist of
201 | a sequence of one or more alphanumeric ASCII characters followed by a
202 | U+003B SEMICOLON character (;), then this is a parse error.”
“If no characters match the range, then don’t consume any characters
230 | (and unconsume the U+0023 NUMBER SIGN character and, if appropriate,
231 | the X character). This is a parse error; nothing is returned.”
Return string as HTML escaped by replacing non-ASCII and unsafe characters
138 | with their numeric character escapes, or if such exists, their HTML named
139 | character reference equivalents. For example, this function turns
Return string as HTML unescaped by replacing HTML character references with their
238 | unicode character equivalents. For example, this function turns
Return string as HTML unescaped by replacing HTML character references with their
296 | unicode character equivalents. For example, this function turns
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.
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.