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, 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, }, }