Skip to content

Fix bug in GLFM spec handling

What does this MR do and why?

Related: Tracking Issue: Implement GLFM scripts per the ... (#361241 - closed)

Fix 1: Incorrect example names

Fixes bug where H3 headings spec.txt were not correctly parsed, resulting in extraneous text from header names being included as part of example names in examples_index.yml and other GLFM snapshot example YML files.

Example of corrected name here: !90561 (diffs)

Screen_Shot_2022-06-23_at_1.04.18_PM

Fix 2: Incorrect handling of disabled examples

Fixes bug where disabled examples in spec.txt were not correctly parsed, resulting in the contents of the disabled examples being incorrectly included in subsequent examples in markdown.yml and html.yml GLFM snapshot example YML files.

Example of correct extra markdown being removed here (includes rename changes from Fix 1 as well): !90561 (diffs)

!90561 (diffs)

Related documentation

See the GLFM Specification Guide section on this script (as well as the rest of the guide) for a detailed explanation of the usage and context of this script.

How to set up and validate locally

  1. Run scripts/glfm/update-example-snapshots.rb locally
  2. See that it results in the correct examples_index.yml contents, the same as the changes to examples_index.yml included in this MR.
  3. Refer to GitHub Flavored Markdown Specification:
    1. https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#github-flavored-markdown-specification
    2. https://gitlab.com/gitlab-org/gitlab/-/blob/master/glfm_specification/input/github_flavored_markdown/ghfm_spec_v_0.29.txt
    3. https://github.github.com/gfm/#task-list-items-extension-
  4. Verify that the 5.2.1 Motivation H3 section is properly skipped and the following sections in examples_index.yml have the proper name.
  5. Verify that the disabled examples in 5.3 Task list items (extension) are properly skipped, and do not impact the following examples in html.yml or markdown.yml or prosemirror_json.yml
  6. Verify that the 5.3 Task list items (extension) section containing only task list examples is omitted from all of the above YML files.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Chad Woolley

Merge request reports

Loading