diff --git a/tasks/website/src/linter/json_schema.rs b/tasks/website/src/linter/json_schema.rs index b42d138546a43..850bb4de2461a 100644 --- a/tasks/website/src/linter/json_schema.rs +++ b/tasks/website/src/linter/json_schema.rs @@ -154,7 +154,7 @@ impl Renderer { } if let Some(subschemas) = &schema.subschemas { let key = parent_key.unwrap_or(""); - return self.render_sub_schema(depth, key, subschemas); + self.render_sub_schema(depth, key, subschemas); } vec![] } @@ -171,7 +171,9 @@ impl Renderer { .map(|schema| { let schema = Self::get_schema_object(schema); let schema = self.get_referenced_schema(schema); - self.render_schema(depth + 1, key, schema) + let mut section = self.render_schema(depth + 1, key, schema); + section.sanitize(); + section }) .collect::>(); } @@ -203,6 +205,12 @@ impl Root { } } +impl Section { + fn sanitize(&mut self) { + sanitize(&mut self.description); + } +} + fn sanitize(s: &mut String) { let Some(start) = s.find("```json") else { return }; let start = start + 7;