Skip to content

Commit

Permalink
self review
Browse files Browse the repository at this point in the history
  • Loading branch information
emmerich committed Apr 13, 2024
1 parent afed832 commit b4a1a7e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/components/DocumentView/CodeBlock/highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ type PositionedToken = ThemedToken & { start: number; end: number };
*/
export async function highlight(block: DocumentBlockCode): Promise<HighlightLine[]> {
const langName = block.data.syntax ? getLanguageForSyntax(block.data.syntax) : null;

if (!langName) {
// Language not found, fallback to plain highlighting
return plainHighlighting(block);
}
debugger;

const inlines: InlineIndexed[] = [];
const code = getPlainCodeBlock(block, inlines);
Expand Down
7 changes: 0 additions & 7 deletions src/components/PageBody/PageBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ import { DocumentView, createHighlightingContext } from '../DocumentView';
import { PageFeedbackForm } from '../PageFeedback';
import { DateRelative } from '../primitives';

/**
* Due to a combination of memory limitations of Cloudflare workers and the memory
* cost of shiki, we need to set a limit on the number of blocks we can highlight
* in a single page.
*/
const CODE_HIGHLIGHT_BLOCK_LIMIT = 50;

export function PageBody(props: {
space: Space;
contentTarget: ContentTarget;
Expand Down

0 comments on commit b4a1a7e

Please sign in to comment.