MCPcopy Create free account
hub / github.com/tinyplex/tinybase / bumpMarkdownHeadings

Function bumpMarkdownHeadings

site/ui/DemoNodeSection.tsx:5–19  ·  view source on GitHub ↗
(markdown: string)

Source from the content-addressed store, hash-verified

3import {getThumbnailMarkdown} from '../thumbnail.ts';
4
5const bumpMarkdownHeadings = (markdown: string): string => {
6 let inFence = false;
7 return markdown
8 .split('\n')
9 .map((line) => {
10 if (line.startsWith('```')) {
11 inFence = !inFence;
12 return line;
13 }
14 return inFence || !line.startsWith('#')
15 ? line
16 : line.replace(/^(#{1,5})(\s)/, '$1#$2');
17 })
18 .join('\n');
19};
20
21export const DemoNodeSection: FunctionComponent<{readonly node: Node}> = ({
22 node,

Callers 1

DemoNodeSectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…