diff --git a/sidebars.js b/sidebars.js index 8edba955928..1d2e849b519 100644 --- a/sidebars.js +++ b/sidebars.js @@ -1343,7 +1343,18 @@ const sidebars = { "operations/startup-scripts", "operations/storing-data", "operations/allocation-profiling", - "operations/backup", + { + type: "category", + label: "Backup/Restore", + collapsed: true, + collapsible: true, + items: [ + { + type: "autogenerated", + dirName: "operations/backup_restore", + } + ] + }, "operations/caches", "operations/workload-scheduling", "operations/update", diff --git a/src/theme/CodeBlock/index.js b/src/theme/CodeBlock/index.js index b8f76b0c582..eb4f10e7077 100644 --- a/src/theme/CodeBlock/index.js +++ b/src/theme/CodeBlock/index.js @@ -4,6 +4,8 @@ import CodeViewer from "../../components/CodeViewer"; function countLines(text) { + // Handle undefined or null input + if (!text) return 1; // Return 1 as default line count // Split the string by newline characters const lines = text.split('\n'); // Return the number of lines @@ -36,7 +38,7 @@ function parseMetaString(meta = '') { export default function CodeBlockWrapper(props) { const lineHeight = 18.85; const [isLoaded, setIsLoaded] = useState(false); - const [estimatedHeight, setEstimatedHeight] = useState(countLines(props.children)*lineHeight); + const [estimatedHeight, setEstimatedHeight] = useState(countLines(props.children || '') * lineHeight); const codeBlockRef = useRef(null); const handleIntersection = useCallback((entries) => {