Skip to content

Commit 1f7436b

Browse files
committed
updated url regular expression. Current REGEX not working for tel:// and custom routes which we created for our project. My solution is just select texts whatever inside href and export. We can handle it in swift based on url.
1 parent d40cd36 commit 1f7436b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SwiftRichString/Style/StyleGroup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public class StyleGroup: StyleProtocol {
8686
private func extractParametersFromTags(_ string: String) -> [String: String]? {
8787
guard let _ = string.firstIndex(of: " ") else { return nil } // no tags
8888

89-
let pattern = "\\w*\\s*=\\s*\"?\\s*([\\w\\s%#\\/\\.;:_-]*)\\s*\"?.*?" // maybe shorter?
89+
let pattern = "\\w*\\s*=\\s*\"?\\s*([^\"]*)\\s*\"?.*?" // maybe shorter?
9090
guard let regex = try? NSRegularExpression(pattern: pattern, options: .dotMatchesLineSeparators) else {
9191
return nil
9292
}

0 commit comments

Comments
 (0)