toc trim white char

This commit is contained in:
Chris Li 2016-10-01 15:05:47 -04:00
parent 49f64ca16f
commit 166bb815c6
4 changed files with 3 additions and 5 deletions

View File

@ -49,7 +49,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.8.1550</string>
<string>1.8.1553</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View File

@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.8.1550</string>
<string>1.8.1553</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionMainStoryboard</key>

View File

@ -15,7 +15,7 @@ class HTMLHeading {
init?(rawValue: [String: String]) {
let tagName = rawValue["tagName"] ?? ""
self.id = rawValue["id"] ?? ""
self.textContent = rawValue["textContent"] ?? ""
self.textContent = (rawValue["textContent"] ?? "").stringByTrimmingCharactersInSet(.whitespaceCharacterSet())
self.tagName = tagName
self.level = Int(tagName.stringByReplacingOccurrencesOfString("H", withString: "")) ?? -1

View File

@ -51,8 +51,6 @@ class KiwixURLProtocol: NSURLProtocol {
}
extension NSURL {
class func kiwixURLWithZimFileid(id: String, contentURLString: String) -> NSURL? {
guard let escapedContentURLString = contentURLString.stringByAddingPercentEncodingWithAllowedCharacters(.URLPathAllowedCharacterSet()) else {return nil}
let baseURLString = "kiwix://" + id