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)
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)
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
- Run
scripts/glfm/update-example-snapshots.rb
locally - See that it results in the correct
examples_index.yml
contents, the same as the changes toexamples_index.yml
included in this MR. - Refer to GitHub Flavored Markdown Specification:
- https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#github-flavored-markdown-specification
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/glfm_specification/input/github_flavored_markdown/ghfm_spec_v_0.29.txt
- https://github.github.com/gfm/#task-list-items-extension-
- Verify that the
5.2.1 Motivation
H3 section is properly skipped and the following sections inexamples_index.yml
have the proper name. - Verify that the disabled examples in
5.3 Task list items (extension)
are properly skipped, and do not impact the following examples inhtml.yml
ormarkdown.yml
orprosemirror_json.yml
- 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.
-
I have evaluated the MR acceptance checklist for this MR.