Format: apply oxfmt fixes

This commit is contained in:
George Pickett
2026-01-14 17:10:16 -08:00
committed by Peter Steinberger
parent 8c1e6a82b2
commit 232c512502
14 changed files with 202 additions and 234 deletions

View File

@@ -25,13 +25,7 @@ type MarkdownToken = {
attrGet?: (name: string) => string | null;
};
export type MarkdownStyle =
| "bold"
| "italic"
| "strikethrough"
| "code"
| "code_block"
| "spoiler";
export type MarkdownStyle = "bold" | "italic" | "strikethrough" | "code" | "code_block" | "spoiler";
export type MarkdownStyleSpan = {
start: number;
@@ -414,11 +408,7 @@ function sliceStyleSpans(
return mergeStyleSpans(sliced);
}
function sliceLinkSpans(
spans: MarkdownLinkSpan[],
start: number,
end: number,
): MarkdownLinkSpan[] {
function sliceLinkSpans(spans: MarkdownLinkSpan[], start: number, end: number): MarkdownLinkSpan[] {
if (spans.length === 0) return [];
const sliced: MarkdownLinkSpan[] = [];
for (const span of spans) {
@@ -465,7 +455,8 @@ export function markdownToIR(markdown: string, options: MarkdownParseOptions = {
if (span.end > codeBlockEnd) codeBlockEnd = span.end;
}
const finalLength = Math.max(trimmedLength, codeBlockEnd);
const finalText = finalLength === state.text.length ? state.text : state.text.slice(0, finalLength);
const finalText =
finalLength === state.text.length ? state.text : state.text.slice(0, finalLength);
return {
text: finalText,

View File

@@ -46,9 +46,7 @@ export function renderMarkdownWithMarkers(ir: MarkdownIR, options: RenderOptions
if (!text) return "";
const styleMarkers = options.styleMarkers;
const styled = sortStyleSpans(
ir.styles.filter((span) => Boolean(styleMarkers[span.style])),
);
const styled = sortStyleSpans(ir.styles.filter((span) => Boolean(styleMarkers[span.style])));
const boundaries = new Set<number>();
boundaries.add(0);