Skip to content

Add Vale test for use of GLFM emoji syntax in Markdown

Russell Dickenson requested to merge russell/vale-exclude-use-of-emoji into master

What does this MR do?

Adds a Vale warning-level test for use of GitLab Flavored Markdown emoji in documentation source files because they're not supported by Kramdown, the Markdown renderer used for the GitLab documentation.

To test for GitLab Flavored Markdown emoji, the following regex is used:

(?:\s+|^):[a-zA-Z0-9\-_\+]+:(?:\s+|$)

Which matches the following sequence in the text scope (which excludes headings, code blocks, and inline code):

  • either at the start of a line, or preceded by one or more spaces, followed by...
  • a colon, followed by...
  • any multiple of letters, digits, hyphens, or underscores, followed by...
  • a colon, followed by...
  • either the end of the line, or one or more spaces, or a period.

Where GLFM emoji are enclosed in backticks, they will not be flagged because the backtick signifies the code syntax, and only content in the text Vale scope are covered by this test.

The following edge cases are not detected by this regex. They are very unlikely, so not worth spending time on:

  • Emoji syntax surrounded by one or more spaces inside backticks.
  • Multiple emoji on the same line, separated by one or more spaces. The first will be detected, which is sufficient.

Related issues

Related to #368682 (closed)

Author's checklist

If you are a GitLab team member and only adding documentation, do not add any of the following labels:

  • ~"frontend"
  • ~"backend"
  • ~"type::bug"
  • ~"database"

These labels cause the MR to be added to code verification QA issues.

Reviewer's checklist

Documentation-related MRs should be reviewed by a Technical Writer for a non-blocking review, based on Documentation Guidelines and the Style Guide.

  • If the content requires it, ensure the information is reviewed by a subject matter expert.
  • Technical writer review items:
    • Ensure docs metadata is present and up-to-date.
    • Ensure the appropriate labels are added to this MR.
    • Ensure a release milestone is set.
    • If relevant to this MR, ensure content topic type principles are in use, including:
      • The headings should be something you'd do a Google search for. Instead of Default behavior, say something like Default behavior when you close an issue.
      • The headings (other than the page title) should be active. Instead of Configuring GDK, say something like Configure GDK.
      • Any task steps should be written as a numbered list.
      • If the content still needs to be edited for topic types, you can create a follow-up issue with the docs-technical-debt label.
  • Review by assigned maintainer, who can always request/require the reviews above. Maintainer's review can occur before or after a technical writer review.
Edited by Russell Dickenson

Merge request reports

Loading