Skip to content

Commit

Permalink
🐛 Code block lineno-start turns on line numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 committed Sep 6, 2022
1 parent 72a986c commit 6c613db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/mystjs/src/mdast/tokensToMyst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ const defaultMdast: Record<string, Spec> = {
const showLineNumbers = !!(
t.meta?.linenos ||
t.meta?.linenos === null || // Weird docutils implementation
t.meta?.['number-lines']
t.meta?.['number-lines'] ||
// If lineno-start is present, linenos option is also automatically activated
// https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-option-code-block-lineno-start
t.meta?.['lineno-start']
);
const lineno = t.meta?.['lineno-start'] ?? t.meta?.['number-lines'];
const startingLineNumber =
Expand Down

0 comments on commit 6c613db

Please sign in to comment.