Skip to content

Fix matching of Substitution based quick actions

John Hope requested to merge jh-fix-substitution-definition-regex into master

What does this MR do?

Simple, substitution-based quick actions like tableflip and shrug work unpredictably, matching even when additional characters are present and executing inside code blocks. For example:

tableflipsajkhsd =>

sajkhsd (╯°□°)╯︵ ┻━┻

shrug123 =>

123 ¯\_(ツ)_/¯

It's not a big deal but it happens also with code blocks, meaning that there's no way to escape these in markdown (such as this description) other than to leave out the /.

This MR fixes both issues, and addresses #24082 (closed).

There are other cases still unaccounted for. For example multi-line code blocks and inline code blocks with trailing spaces.

Screenshots

image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by John Hope

Merge request reports