mirror of
https://github.com/otaviocc/Triton.git
synced 2026-01-30 04:04:27 +00:00
Handle line break in slugified()
This commit is contained in:
parent
8572716a73
commit
3a86d153ea
1 changed files with 1 additions and 1 deletions
|
|
@ -19,7 +19,7 @@ public extension String {
|
||||||
/// ```
|
/// ```
|
||||||
func slugified() -> String {
|
func slugified() -> String {
|
||||||
trimmingCharacters(in: .whitespacesAndNewlines)
|
trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
.components(separatedBy: .whitespaces)
|
.components(separatedBy: .whitespacesAndNewlines)
|
||||||
.filter { !$0.isEmpty }
|
.filter { !$0.isEmpty }
|
||||||
.joined(separator: "-")
|
.joined(separator: "-")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue