The test coverage here actually proves that for Liquid expressions, the issue has already been fixed as part of other work. Specifically it was fixed in 2a22a328c4 in the class StringExtensions.cs
2a22a328c4