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
8 changes: 5 additions & 3 deletions site/api/components/P.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ export function P(
continue;
}
if (!inCodeBlock) {
while (/<.+>/.test(part)) {
part = part.replace(/<(.+)>/, "&lt;$1&gt;");
}
// Escape each pair of angle brackets individually. The inner class
// `[^<>]+` keeps a single `<...>` from greedily swallowing every
// bracketed placeholder in the same sentence — see
// https://github.com/grammyjs/website/issues/1027.
part = part.replace(/<([^<>]+)>/g, "&lt;$1&gt;");
newParts.push(part);
} else {
newParts.push(part);
Expand Down