Skip to content

Commit

Permalink
feat: render code blocks in front
Browse files Browse the repository at this point in the history
  • Loading branch information
aalemayhu committed Oct 9, 2022
1 parent 3830e0b commit 5af5824
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/notion/helpers/renderFront.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { GetBlockResponse } from '@notionhq/client/build/src/api-endpoints';
import { captureException } from '@sentry/node';

import BlockHandler from '../BlockHandler';
import BlockCode from '../blocks/BlockCode';
import { BlockHeading } from '../blocks/BlockHeadings';
import FrontFlashcard from '../blocks/FrontFlashcard';
import BlockColumn from '../blocks/lists/BlockColumn';
Expand Down Expand Up @@ -33,6 +34,11 @@ export default async function renderFront(
return `<img src='${getImageUrl(block)}' />`;
}
break;
case 'code':
if (handler.settings.learnMode) {
return BlockCode(block, handler);
}
break;
case 'toggle':
// @ts-ignore
const { toggle } = block;
Expand Down

0 comments on commit 5af5824

Please sign in to comment.