Skip to content

Commit aac8936

Browse files
committed
Fixed vertical whitespace characters being removed from speechresponder.out
Resolves #2797
1 parent a093a3b commit aac8936

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Full details of the variables available for each noted event, and VoiceAttack in
44

55
## 5.0.1
66
* Speech Responder
7+
* Fixed vertical whitespace characters being removed from speechresponder.out. (#2797
78
* Custom Functions
89
* `StopSpeaking` function signature corrected - it should now work as documented. (#2799)
910
* VoiceAttack

SpeechResponder/ScriptResolverService/ScriptResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public static string resolveFromValue(string script, IContext context, bool isTo
131131
// Tidy up the output script
132132
if ( isTopLevelScript )
133133
{
134-
result = GeneratedRegex.WhiteSpaceTwoOrMoreRegex().Replace( result, " " )
134+
result = GeneratedRegex.TabsOrTwoOrMoreSpacesRegex().Replace( result, " " )
135135
.Replace( " ,", "," )
136136
.Replace( " .", "." ).Trim();
137137
result = result.Trim() == "" ? null : result.Trim();

Utilities/GeneratedRegex.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ [ GeneratedRegex( @"^(?<engine>0|[1-9]\d*)\.(?<major>0|[1-9]\d*)(?:\.(?<minor>\d
106106
[GeneratedRegex( @"^\bA[BCDE]?[CDE]?[DE]?[E]?\b|\bB[CDE]?[DE]?[E]?\b|\bC[DE]?[E]?\b|\bD[E]?\b$", RegexOptions.Compiled )]
107107
public static partial Regex SUBSTARS ();
108108

109+
[GeneratedRegex( @"\t| {2,}", RegexOptions.Compiled )] // Intentionally preserves vertical line whitespace characters like new lines for speechresponder.out.
110+
public static partial Regex TabsOrTwoOrMoreSpacesRegex ();
111+
109112
[GeneratedRegex( @"([A-Za-z]{1,3}(?:\s|$))", RegexOptions.Compiled )]
110113
public static partial Regex TEXT ();
111114

0 commit comments

Comments
 (0)