From 3f4f3ed65193c8d0f59241bee0146c1e12d3b647 Mon Sep 17 00:00:00 2001 From: Grace Park Date: Wed, 29 May 2024 17:32:06 -0700 Subject: [PATCH 1/2] GHD017 - update range error (#50879) Co-authored-by: Kevin Heis --- src/content-linter/lib/linting-rules/liquid-syntax.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/content-linter/lib/linting-rules/liquid-syntax.js b/src/content-linter/lib/linting-rules/liquid-syntax.js index c013d0d9e0..58f90172c6 100644 --- a/src/content-linter/lib/linting-rules/liquid-syntax.js +++ b/src/content-linter/lib/linting-rules/liquid-syntax.js @@ -36,7 +36,13 @@ export const frontmatterLiquidSyntax = { // Add the key length plus 3 to the column number to account colon and // for the space after the key and column number starting at 1. // If there is no space after the colon, a YAMLException will be thrown. - const range = [columnNumber + key.length + 3, value.length] + const startRange = columnNumber + key.length + 3 + // If the range is greater than the length of the line, we need to adjust the range to the end of the line + const endRange = + startRange + value.length - 1 > params.lines[lineNumber - 1].length + ? params.lines[lineNumber - 1].length - startRange + 1 + : value.length + const range = [startRange, endRange] addError( onError, lineNumber, From b93cf123e9fb6f33d58d8e70b5d52427ff6ac329 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Wed, 29 May 2024 20:33:53 -0400 Subject: [PATCH 2/2] Filter *additionally* by top-level, not union (#50875) Co-authored-by: Kevin Heis --- src/search/middleware/es-search.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/search/middleware/es-search.js b/src/search/middleware/es-search.js index a5eb86e456..58694efc98 100644 --- a/src/search/middleware/es-search.js +++ b/src/search/middleware/es-search.js @@ -84,6 +84,8 @@ export async function getSearchResults({ const matchQuery = { bool: { should: matchQueries, + // This allows filtering by toplevel later. + minimum_should_match: 1, }, }