Trimming whitespace to prevent double spaces from occurring.
This commit is contained in:
parent
0a3bd5c834
commit
db672f1c21
@ -384,9 +384,9 @@ public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProt
|
|||||||
let actionableTuple: ActionableStringTuple = rangeOfText(text, startTag: startTag, endTag: endTag)
|
let actionableTuple: ActionableStringTuple = rangeOfText(text, startTag: startTag, endTag: endTag)
|
||||||
|
|
||||||
if let front = actionableTuple.front, let middle = actionableTuple.middle, let end = actionableTuple.end {
|
if let front = actionableTuple.front, let middle = actionableTuple.middle, let end = actionableTuple.end {
|
||||||
frontText = front
|
frontText = front.trimmingCharacters(in: .whitespaces)
|
||||||
actionText = middle
|
actionText = middle.trimmingCharacters(in: .whitespaces)
|
||||||
backText = end
|
backText = end.trimmingCharacters(in: .whitespaces)
|
||||||
self.text = getTextFromStringComponents()
|
self.text = getTextFromStringComponents()
|
||||||
} else {
|
} else {
|
||||||
frontText = text
|
frontText = text
|
||||||
@ -408,7 +408,6 @@ public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProt
|
|||||||
actionableTuple.front = firstHalf.first
|
actionableTuple.front = firstHalf.first
|
||||||
|
|
||||||
if let rightTag = endTag, text.contains(rightTag) {
|
if let rightTag = endTag, text.contains(rightTag) {
|
||||||
|
|
||||||
let secondHalf = firstHalf[1].components(separatedBy: rightTag)
|
let secondHalf = firstHalf[1].components(separatedBy: rightTag)
|
||||||
actionableTuple.middle = secondHalf[0]
|
actionableTuple.middle = secondHalf[0]
|
||||||
actionableTuple.end = secondHalf[1]
|
actionableTuple.end = secondHalf[1]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user