{"record":{"id":"0c045095806ccd6f","repo":"gatsbyjs/gatsby","slug":"invalid-match-specified-line-trim","errorCode":null,"errorMessage":"Invalid match specified: \"${line.trim()}\"","messagePattern":"Invalid match specified: \"(.+?)\"","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-remark-prismjs/src/directives.js","lineNumber":103,"sourceCode":"    case `line`:\n      actions.flag(feature, index, flagSource)\n      actions.stripComment(index)\n      break\n    case `range`:\n      actions.hide(index)\n\n      if (directiveRange) {\n        const strippedDirectiveRange = directiveRange.slice(1, -1)\n        const range = rangeParser(strippedDirectiveRange)\n        if (range.length > 0) {\n          range.forEach(relativeIndex => {\n            actions.flag(feature, index + relativeIndex, flagSource)\n          })\n          break\n        }\n      }\n\n      console.warn(`Invalid match specified: \"${line.trim()}\"`)\n      break\n  }\n}\n\nmodule.exports = function highlightLineRange(code, highlights = []) {\n  if (highlights.length > 0 || HIGHLIGHT_DIRECTIVE.test(code)) {\n    // HACK split multiline spans with line separators inside into multiple spans\n    // separated by line separator - this fixes line highlighting behaviour for\n    //  - plain-text in jsx,\n    //  - tripple-quoted-string in python,\n    //  - comment in c-like languages (including javascript), etc.\n    code = code.replace(MULTILINE_TOKEN_SPAN, (match, token) =>\n      match.replace(/\\n/g, `</span>\\n<span class=\"token ${token}\">`)\n    )\n  }\n\n  const split = code.split(`\\n`)\n  const lines = split.map(code => {","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-remark-prismjs/src/directives.js#L85-L121","documentation":"Directive-parser warning in gatsby-remark-prismjs: for a `line`/`range` highlight directive, the range portion could not be parsed (rangeParser returned no entries, or the range segment was malformed), so the requested lines are not highlighted/flagged. Only that directive is ignored; highlighting of the block continues.","triggerScenarios":"Thrown at packages/gatsby-remark-prismjs/src/directives.js:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the directive range syntax, e.g. {1,3-5} after the language tag"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}