1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 20:07:24 +08:00
osu-lazer/osu.Game.Tests/Visual/Online
Bartłomiej Dach a8f16503e2 Add backslash escaping to new link format
For users to be able to add square brackets inside of links using
the new format, the regular expression used for parsing those links
contained a balancing group, which can be used for matching pairs
of tokens (in this case, opening and closing brackets, in that order).
However, this means that users could not post links with unmatched
brackets inside of them (ie. ones that contain single brackets, or
a closing bracket and then an opening one). Allow for escaping opening
and closing brackets using the backslash character.

The change substitutes this old fragment of the regex in the display
text group:

    [^\[\]]*        // any character other than closing/opening bracket

for this one:

    (((?<=\\)[\[\]])|[^\[\]])*

The second pattern in the alternative remains the same; the first one
performs the escaping, as follows:

    (
        (?<=\\)     // positive lookbehind expression:
                    // this match will succeed, if the next expression
                    // is preceded by a single backslash
        [\[\]]      // either an opening or closing brace
    )

Since the entire display group is matched, unfortunately the lookbehind
expression does not actually strip the backslashes, so they are
manually stripped in handleMatches.

As demonstrated in the unit tests attached, this also allows balanced
brackets to be mixed with escaped ones.
2019-09-03 23:18:39 +02:00
..
TestSceneAccountCreationOverlay.cs Update VisibilityContainer usage in line with framework 2019-06-11 15:13:58 +09:00
TestSceneBeatmapAvailability.cs Rename class to BeatmapAvailability 2019-06-27 11:40:22 +09:00
TestSceneBeatmapSetOverlay.cs Update to match api 2019-08-29 12:29:31 +03:00
TestSceneBeatmapSetOverlayDetails.cs Add some randomness 2019-06-13 18:43:44 +09:00
TestSceneBeatmapSetOverlaySuccessRate.cs Add success rate test scene 2019-06-13 18:44:00 +09:00
TestSceneChangelogOverlay.cs Add messaging telling users how to leave changelog comments 2019-07-04 15:47:06 +09:00
TestSceneChannelTabControl.cs Fix a few inspections from EAP r# 2019-07-08 16:34:11 +09:00
TestSceneChatLink.cs Add backslash escaping to new link format 2019-09-03 23:18:39 +02:00
TestSceneChatOverlay.cs Add test 2019-07-29 02:46:33 +09:00
TestSceneDirectDownloadButton.cs Rename download buttons to avoid ambiguity 2019-07-03 12:02:35 +09:00
TestSceneDirectOverlay.cs Add disable trigger to a testcase 2019-07-02 13:22:38 +03:00
TestSceneDirectPanel.cs Add many difficulties beatmap direct panel to the tests 2019-08-24 00:31:36 +03:00
TestSceneExternalLinkButton.cs Rename test cases to test scenes inline with the framework change 2019-05-14 22:37:25 +03:00
TestSceneFullscreenOverlay.cs Add test 2019-06-11 15:39:18 +09:00
TestSceneGraph.cs Rename test cases to test scenes inline with the framework change 2019-05-14 22:37:25 +03:00
TestSceneHistoricalSection.cs Merge remote-tracking branch 'refs/remotes/ppy/master' into underscored_link 2019-07-14 19:10:47 +03:00
TestSceneKudosuHistory.cs Refactor to match web implementation 1:1 2019-09-02 17:04:38 +09:00
TestSceneLeaderboardScopeSelector.cs CI fix 2019-08-07 08:49:04 +03:00
TestSceneProfileRulesetSelector.cs TestCase improvement 2019-08-04 15:00:02 +03:00
TestSceneRankGraph.cs Move RankHistoryData to User Statistics 2019-08-04 14:35:26 +03:00
TestSceneScoresContainer.cs Move request inside the ScoresContainer again 2019-07-10 19:40:29 +03:00
TestSceneShowMoreButton.cs Add proper tests 2019-06-04 10:26:35 +09:00
TestSceneSocialOverlay.cs Rename test cases to test scenes inline with the framework change 2019-05-14 22:37:25 +03:00
TestSceneStandAloneChatDisplay.cs Rename test cases to test scenes inline with the framework change 2019-05-14 22:37:25 +03:00
TestSceneUserPanel.cs Move activity (writable) bindable to APIAccess so it correctly transfers between users 2019-06-12 18:04:57 +09:00
TestSceneUserProfileHeader.cs Add a testcase 2019-06-19 12:34:01 +03:00
TestSceneUserProfileOverlay.cs Move RankHistoryData to User Statistics 2019-08-04 14:35:26 +03:00
TestSceneUserProfilePreviousUsernames.cs Drop container from name 2019-08-13 14:09:10 +09:00
TestSceneUserProfileRecentSection.cs Update ScrollContainer usages in line with framework changes 2019-06-14 15:55:32 +09:00
TestSceneUserRanks.cs Update ScrollContainer usages in line with framework changes 2019-06-14 15:55:32 +09:00
TestSceneUserRequest.cs Add Testing 2019-08-07 09:31:07 +03:00