@@ -64,14 +64,14 @@ private extension StringFormatter {
6464 /// we use these so that the ranges are still in the right position, but the extra space basically disappears
6565 ///
6666 let output = baseString
67- . replacingOccurrences ( of: " \t " , with: String . hairSpace + String. hairSpace) // tabs before a space
68- . replacingOccurrences ( of: " \t " , with: String . space + String. hairSpace) // tabs after a space
69- . replacingOccurrences ( of: " \t @ " , with: String . hairSpace + " @ " ) // tabs before @mentions
70- . replacingOccurrences ( of: " \t . " , with: String . hairSpace + " . " ) // tabs before a space
71- . replacingOccurrences ( of: " \t , " , with: String . hairSpace + " , " ) // tabs cefore a comman
72- . replacingOccurrences ( of: " \n \t \n \t " , with: String . hairSpace + String. hairSpace + " \n \t " ) // extra newline-with-tab before a newline-with-tab
67+ . replacingOccurrences ( of: " \t " , with: String . hairSpace + String. hairSpace)
68+ . replacingOccurrences ( of: " \t " , with: String . space + String. hairSpace)
69+ . replacingOccurrences ( of: " \t @ " , with: String . hairSpace + " @ " )
70+ . replacingOccurrences ( of: " \t . " , with: String . hairSpace + " . " )
71+ . replacingOccurrences ( of: " \t , " , with: String . hairSpace + " , " )
72+ . replacingOccurrences ( of: " \n \t \n \t " , with: String . hairSpace + String. hairSpace + " \n \t " )
7373
74- // if the length of the string changes the range-based formatting will break
74+ // Failsafe: If the length of the string changes the range-based formatting will break
7575 guard output. count == baseString. count else {
7676 return baseString
7777 }
0 commit comments