rehype-highlight-code-lines
Advanced tools
Comparing version
@@ -52,6 +52,6 @@ import { visit, CONTINUE } from "unist-util-visit"; | ||
const firstChild = children[0]; | ||
const isAddition = firstChild.type === "element" && | ||
const isAddition = firstChild?.type === "element" && | ||
Array.isArray(firstChild.properties.className) && | ||
firstChild.properties.className.some((cls) => typeof cls === "string" && cls.includes("addition")); | ||
const isDeletion = firstChild.type === "element" && | ||
const isDeletion = firstChild?.type === "element" && | ||
Array.isArray(firstChild.properties.className) && | ||
@@ -58,0 +58,0 @@ firstChild.properties.className.some((cls) => typeof cls === "string" && cls.includes("deletion")); |
{ | ||
"name": "rehype-highlight-code-lines", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Rehype plugin to add line numbers to code blocks and allow highlighting of desired code lines", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -91,4 +91,5 @@ import type { Plugin } from "unified"; | ||
const firstChild = children[0]; | ||
const isAddition = | ||
firstChild.type === "element" && | ||
firstChild?.type === "element" && | ||
Array.isArray(firstChild.properties.className) && | ||
@@ -98,4 +99,5 @@ firstChild.properties.className.some( | ||
); | ||
const isDeletion = | ||
firstChild.type === "element" && | ||
firstChild?.type === "element" && | ||
Array.isArray(firstChild.properties.className) && | ||
@@ -102,0 +104,0 @@ firstChild.properties.className.some( |
Sorry, the diff of this file is not supported yet
42960
0.01%