From 7173e6a20b3a26549fb695d77978476218244904 Mon Sep 17 00:00:00 2001 From: InSync Date: Sun, 15 Dec 2024 23:07:29 +0700 Subject: [PATCH] Use stripping block (`|-`) for page descriptions (#14980) ## Summary Resolves #14976. Currently, we uses this "[plain scalar](https://yaml.org/spec/1.2.2/#733-plain-style)" format: ```yaml description: Checks for `if key in dictionary: del dictionary[key]`. ``` Plain scalar must not contain the sequence `: `, however, so the above is invalid. This PR changes that to: ```yaml description: |- Checks for `if key in dictionary: del dictionary[key]`. ``` `|` denotes a "[block scalar](https://yaml.org/spec/1.2.2/#81-block-scalar-styles)", whereas [the `-` chomping indicator](https://yaml.org/spec/1.2.2/#8112-block-chomping-indicator) requires that a trailing newline, if any, must be stripped. ## Test Plan ![](https://github.com/user-attachments/assets/f00b606a-d6fe-46ac-a1c5-6a8665204ea3) --- scripts/generate_mkdocs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/generate_mkdocs.py b/scripts/generate_mkdocs.py index 612e3e3523..8a38f8c173 100644 --- a/scripts/generate_mkdocs.py +++ b/scripts/generate_mkdocs.py @@ -157,7 +157,8 @@ def generate_rule_metadata(rule_doc: Path) -> None: "\n".join( [ "---", - f"description: {description}", + "description: |-", + f" {description}", "tags:", f"- {rule_code}", "---",