Skip to content

Commit

Permalink
Fix issue #29 by stripping Style tags
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardrowe committed May 12, 2019
1 parent e454e2d commit b8a0e48
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Assets/RedBlueGames/TextTyper/Tests/Editor/TextTagParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,17 @@ public void RemoveCustomTags_OnlyCustomRichTextTags_ReturnsEmpty( )

Assert.AreEqual(expectedText, generatedText);
}

[Test]
public void RemoveUnityTags_AllUnityTags_ReturnsNoTags( )
{
//"b", "i", "size", "color", "style" };
var textToType = "<b>a</b><i>b</i><size=40>c</size><color=red>d</color><style=C1>e</style>";
var generatedText = TextTagParser.RemoveUnityTags(textToType);

var expectedText = "abcde";

Assert.AreEqual(expectedText, generatedText);
}
}
}
2 changes: 1 addition & 1 deletion Assets/RedBlueGames/TextTyper/TextTagParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public struct CustomTags
public const string Animation = "animation";
}

private static readonly List<string> UnityTagTypes = new List<string> { "b", "i", "size", "color" };
private static readonly List<string> UnityTagTypes = new List<string> { "b", "i", "size", "color", "style" };
private static readonly List<string> CustomTagTypes = new List<string>
{
CustomTags.Delay,
Expand Down

0 comments on commit b8a0e48

Please sign in to comment.