dotnet / try

Try .NET provides developers and content authors with tools to create interactive experiences.
MIT License
2.9k stars 526 forks source link

More than two periods in a row in the code will not work #1240

Closed mogura0529 closed 4 weeks ago

mogura0529 commented 4 weeks ago

Describe the bug

Please provide as much information as you can. If Console.Write or comment contains a code with two or more consecutive periods, the value will not be output correctly.

Did this error occur while using dotnet try or online?

What kind of error was it?

Screenshots

If applicable, add screenshots to help explain your problem. Image Image

Please complete the following:

jonsequitur commented 4 weeks ago

This is causing a CORS error. It looks like the specific string that triggers it is .." occurring anywhere in the code submission.

For example, this will work (note the .. in the second line):

List<int> xs = [1, 2, 3, 4, 5];
Console.WriteLine(xs[2..].Count);

But this will trigger the error:

List<int> xs = [1, 2, 3, 4, 5];
// .."
Console.WriteLine(xs[2..].Count);
jonsequitur commented 4 weeks ago

This is now fixed. Thanks for opening this issue @mogura0529!