Skip to content

Commit

Permalink
Add startingLineNumber prop to CodeSnippet
Browse files Browse the repository at this point in the history
component
  • Loading branch information
JeelRajodiya committed May 30, 2024
1 parent 0096cf6 commit 7edf236
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/components/CodeSnippet/CodeSnippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ export default function CodeSnippet({
children,
highlightLineStart,
highlightLineEnd,
startingLineNumber,
}: {
children: string;
highlightLineStart?: number;
highlightLineEnd?: number;
startingLineNumber?: number;
}) {
if ((children.match(/\n/g) || []).length === 0) {
return <span className={styles.inlineCode}>{children}</span>;
Expand All @@ -29,6 +31,7 @@ export default function CodeSnippet({
showLineNumbers={true}
wrapLines={true}
wrapLongLines={true}
startingLineNumber={startingLineNumber}
lineProps={(lineNumber) => {
let style = {};
if (
Expand Down

0 comments on commit 7edf236

Please sign in to comment.