Skip to content

Commit 72aa309

Browse files
authored
Merge pull request #78 from wberger/patch-1
Allow dashes in tag attribute names
2 parents 79f006d + 184156b commit 72aa309

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*([^\"][^\"]*)\\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)