Skip to content

Commit ae92d3a

Browse files
committed
remove markdown links
1 parent 074e4ed commit ae92d3a

File tree

2 files changed

+9
-93
lines changed

2 files changed

+9
-93
lines changed

packages/react/src/hooks/cloud/krisp/useKrispNoiseFilter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface useKrispNoiseFilterOptions {
2525
* Defaults to the localParticipant's microphone track publication, but you can override this behavior by passing in a different track reference.
2626
*
2727
* @package \@livekit/components-react/krisp
28-
* @remarks This filter requires that you install the `@livekit/krisp-noise-filter` package and is supported only on [LiveKit Cloud](https://cloud.livekit.io).
28+
* @remarks This filter requires that you install the `@livekit/krisp-noise-filter` package and is supported only on {@link https://cloud.livekit.io | LiveKit Cloud}.
2929
* @beta
3030
* @example
3131
* ```tsx

tooling/api-documenter/src/documenters/MarkdownDocumenter.ts

Lines changed: 8 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export class MarkdownDocumenter {
262262
);
263263
}
264264

265-
this._appendSection(output, this._processMarkdownContent(tsdocComment.summarySection));
265+
this._appendSection(output, tsdocComment.summarySection);
266266
}
267267
}
268268

@@ -501,10 +501,7 @@ export class MarkdownDocumenter {
501501
// Write the @remarks block
502502
if (tsdocComment.remarksBlock) {
503503
output.appendNode(new DocHeading({ configuration, title: 'Remarks', level: 2 }));
504-
this._appendSection(
505-
output,
506-
this._processMarkdownContent(tsdocComment.remarksBlock.content),
507-
);
504+
this._appendSection(output, tsdocComment.remarksBlock.content);
508505
}
509506

510507
// Write the @example blocks
@@ -583,85 +580,15 @@ export class MarkdownDocumenter {
583580
newContent.appendNode(exampleBlock.content.nodes[i]);
584581
}
585582

586-
this._appendSection(output, this._processMarkdownContent(newContent));
583+
this._appendSection(output, newContent);
587584
} else {
588-
this._appendSection(output, this._processMarkdownContent(exampleBlock.content));
585+
this._appendSection(output, exampleBlock.content);
589586
}
590587
}
591588
}
592589
}
593590
}
594591

595-
private _processMarkdownContent(content: DocSection): DocSection {
596-
const configuration: TSDocConfiguration = this._tsdocConfiguration;
597-
const processedSection: DocSection = new DocSection({ configuration });
598-
599-
// Process each node in the content
600-
for (const node of content.nodes) {
601-
if (node.kind === DocNodeKind.Paragraph) {
602-
const paragraph: DocParagraph = node as DocParagraph;
603-
const processedParagraph: DocParagraph = new DocParagraph({ configuration });
604-
605-
// Process each child node in the paragraph
606-
for (const child of paragraph.getChildNodes()) {
607-
if (child.kind === DocNodeKind.PlainText || child.kind === DocNodeKind.EscapedText) {
608-
const text: string =
609-
child.kind === DocNodeKind.PlainText
610-
? (child as DocPlainText).text
611-
: (child as DocEscapedText).decodedText;
612-
613-
// Look for markdown links [text](url)
614-
const linkRegex: RegExp = /\[([^\]]+)\]\(([^)]+)\)/g;
615-
let lastIndex: number = 0;
616-
let match: RegExpExecArray | null;
617-
618-
while ((match = linkRegex.exec(text)) !== null) {
619-
// Add any text before the link
620-
if (match.index > lastIndex) {
621-
processedParagraph.appendNode(
622-
new DocPlainText({
623-
configuration,
624-
text: text.substring(lastIndex, match.index),
625-
}),
626-
);
627-
}
628-
629-
// Add the link
630-
processedParagraph.appendNode(
631-
new DocLinkTag({
632-
configuration,
633-
tagName: '@link',
634-
linkText: match[1],
635-
urlDestination: match[2],
636-
}),
637-
);
638-
639-
lastIndex = match.index + match[0].length;
640-
}
641-
642-
// Add any remaining text
643-
if (lastIndex < text.length) {
644-
processedParagraph.appendNode(
645-
new DocPlainText({
646-
configuration,
647-
text: text.substring(lastIndex),
648-
}),
649-
);
650-
}
651-
} else {
652-
processedParagraph.appendNode(child);
653-
}
654-
}
655-
656-
processedSection.appendNode(processedParagraph);
657-
} else {
658-
processedSection.appendNode(node);
659-
}
660-
}
661-
662-
return processedSection;
663-
}
664-
665592
private _writeThrowsSection(output: DocSection, apiItem: ApiItem): void {
666593
const configuration: TSDocConfiguration = this._tsdocConfiguration;
667594

@@ -679,9 +606,7 @@ export class MarkdownDocumenter {
679606
output.appendNode(new DocHeading({ configuration, title: heading }));
680607

681608
for (const throwsBlock of throwsBlocks) {
682-
// Process throws blocks for markdown links
683-
const processedContent = this._processMarkdownContent(throwsBlock.content);
684-
this._appendSection(output, processedContent);
609+
this._appendSection(output, throwsBlock.content);
685610
}
686611
}
687612
}
@@ -1283,10 +1208,7 @@ export class MarkdownDocumenter {
12831208

12841209
if (apiParameterListMixin instanceof ApiDocumentedItem) {
12851210
if (apiParameterListMixin.tsdocComment?.returnsBlock) {
1286-
this._appendSection(
1287-
output,
1288-
this._processMarkdownContent(apiParameterListMixin.tsdocComment.returnsBlock.content),
1289-
);
1211+
this._appendSection(output, apiParameterListMixin.tsdocComment.returnsBlock.content);
12901212
}
12911213
}
12921214

@@ -1498,9 +1420,7 @@ export class MarkdownDocumenter {
14981420

14991421
if (apiItem instanceof ApiDocumentedItem) {
15001422
if (apiItem.tsdocComment !== undefined) {
1501-
// Process summary section for markdown links
1502-
const processedSummary = this._processMarkdownContent(apiItem.tsdocComment.summarySection);
1503-
this._appendAndMergeSection(section, processedSummary);
1423+
this._appendAndMergeSection(section, apiItem.tsdocComment.summarySection);
15041424
}
15051425
}
15061426

@@ -1674,11 +1594,7 @@ export class MarkdownDocumenter {
16741594
for (const node of docSection.nodes) {
16751595
if (firstNode) {
16761596
if (node.kind === DocNodeKind.Paragraph) {
1677-
// Process paragraph nodes for markdown links
1678-
const processedParagraph = this._processMarkdownContent(
1679-
new DocSection({ configuration: this._tsdocConfiguration }, [node]),
1680-
);
1681-
output.appendNodesInParagraph(processedParagraph.nodes[0].getChildNodes());
1597+
output.appendNodesInParagraph(node.getChildNodes());
16821598
firstNode = false;
16831599
continue;
16841600
}

0 commit comments

Comments
 (0)