alexisakers / htmlstring Goto Github PK
View Code? Open in Web Editor NEWEscape and unescape HTML entities in Swift
License: MIT License
Escape and unescape HTML entities in Swift
License: MIT License
This issue is iOS 13 specific.
We use the removingHTMLEntities
property on long html strings. We see this crash on rare occasions - about 800 cases per 1 million sessions. It also seems that similar calls on the same string would not result in a crash. So we believe this is a threading issue.
Crashlytics data:
crash_info:
Fatal error: file /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Binaries/swiftlang/install/TempContent/Objects/BNI_iOS/swift-macosx-x86_64/stdlib/public/core/8/UnsafeBufferPointer.swift, line 886
Stack trace:
Crashed: com.apple.main-thread
0 libswiftCore.dylib 0x1932103bc closure #1 in closure #1 in closure #1 in _assertionFailure(_:_:file:line:flags:) + 456
1 libswiftCore.dylib 0x19320f834 _assertionFailure(_:_:file:line:flags:) + 472
2 libswiftCore.dylib 0x19320fb3c _fatalErrorMessage(_:_:file:line:flags:) + 44
3 libswiftCore.dylib 0x19335aa08 _scalarAlign(_:_:) + 1010
4 libswiftCore.dylib 0x19335a21c _stringCompareInternal(_:_:expecting:) + 612
5 HTMLString 0x103345f18 $sSS10HTMLStringE18removeHTMLEntitiesyyF + 236
6 HTMLString 0x103346ebc $sSS10HTMLStringE21addingUnicodeEntitiesSSvgTm + 40
Hi,
I was wondering if there was a plan to do an update to include Privacy Manifest file?
Looking at the latest commits, I wonder if the project is still maintained too π
I'm using the library to remove HTML entities from Strings on my tvOS project and found out that a string like: Mary & Joe are getting "Married\"
, due to the &
between Mary and Joe words. It returns the String as is without replacing any HTML entities.
If I remove that or even encode it as HTML entities, than calling removingHTMLEntities
works as expected.
I am using library with Xcode 10.2.1 (Swift 5), and found following code will throw Fatal error inside removeHTMLEntities
let jsonString = "{\"sepcialCharacter\": \"πΈπΊπΆ°\"}"
let json = try! JSONSerialization.jsonObject(with: jsonString.data(using: .utf8)!, options: []) as! [String:String]
let sepcialCharacter = json["sepcialCharacter"]!
sepcialCharacter.removingHTMLEntities
After investigation, seem this error may cause by NSString
to swift String
bridging with following code, not sure this is the bug in swift or the library itself
let nsSepcialCharacter = NSString("πΈπΊπΆ°")
let sepcialCharacter = nsSepcialCharacter as String
sepcialCharacter.removingHTMLEntities
I may be using it incorrectly, but shouldn't HTMLString encode ββ (left and right curly quotes) into β and β and ellipsis β¦ into β¦? I do this manually now before calling addingUnicodeEntities. Or do I misunderstand how it should work?
I'm using HTMLStrings 6.0.0. Looks like simply calling -[NSString stringByRemovingHTMLEntities]
is causing an infinite loop. See attached.
Example invocation context:
NSString *const htmlEncodedString = @"Apple's Tim Cook on a "giant leap" in social progress;
NSString *const noEntities = [htmlEncodedString stringByRemovingHTMLEntities]; // Hangs
it's really strange but Xcode 10.2 freeze on HTMLString during a creation of the archive.
Hi, I checked that there is Package.swift
. Is Swift package manager supported already? Thanks!
The README.md suggests that "~> 5.0" is the current Pod version but the tag for it does not exist (I didn't check the master repo if that is ok though).
Your readme pod badge also suggests that the latest version is 4.0.2.
Code won't compile on Xcode 9. Some of String init methods are optionals.
I'm try using carthage, run carthage update command in bash, then error shows:
A shell task (/usr/bin/env git clone --bare --quiet https://github.com/alexaurby/HTMLString.git /Users/virus1993/Library/Caches/org.carthage.CarthageKit/dependencies/HTMLString) failed with exit code 128:
remote: Repository not found.
fatal: repository 'https://github.com/alexaurby/HTMLString.git/' not found
My Carthage file:
github "alexaurby/HTMLString" ~> 4.0
Oooops!
It should be:
github "alexaubry/HTMLString" ~> 4.0
Your should correct README.md. it almost let me give up this nice framework.
Thanks to your framework, save lots of my time to Unescape some horrible text.
Have a nice day!
Hi! the Dash link is pointing to dash-feed://https%3A%2F%2Falexaubry%2Egithub%2Eio%2Fdocsets%2FHTMLString%2Exml
(ironically this link has many html escaped characters)(https://alexaubry.github.io/docsets/HTMLString.xml
) instead of https://alexaubry.github.io/HTMLString/docsets/HTMLString.xml
.
And the xml file looks like:
<entry>
<version>4.0.0</version>
<url>https://alexaubry.github.io/docsets/HTMLString.tgz</url>
</entry>
instead of <url>https://alexaubry.github.io/HTMLString/docsets/HTMLString.tgz</url>
This can be fixed in a pr, but maybe it's better to fix this in docs generate script thing?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.