Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions site/api/components/P.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,7 @@ export function P(
},
) {
if (props.doc && props.children) {
const parts = props.children.split(/(```|```ts)/);
const newParts = new Array<string>();
let inCodeBlock = false;
for (let part of parts) {
if (part == "```" || part == "```ts" || part == "```ts:no-line-numbers") {
inCodeBlock = !inCodeBlock;
newParts.push(part);
continue;
}
if (!inCodeBlock) {
while (/<.+>/.test(part)) {
part = part.replace(/<(.+)>/, "&lt;$1&gt;");
}
newParts.push(part);
} else {
newParts.push(part);
}
}
props.children = newParts
.join("")
props.children = props.children
.replaceAll("```ts", "```ts:no-line-numbers");
props.children = replaceModuleSymbolLinks(
props.children,
Comment thread
KnorpelSenf marked this conversation as resolved.
Expand Down
Loading