Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for line numbers in Markdown code fences #1381

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

coreyasmith
Copy link
Contributor

Older versions of Ghost (2 and earlier?) used to support line numbers in Markdown code fences by adding line-numbers after the language:

```ruby line-numbers
foo = "bar"
```

This would be rendered as:

<pre>
  <code class="line-numbers language-ruby">
  foo = "bar"
  </code>
</pre>

The Prism Line Numbers plugin would then render line numbers for that code block.

This pull request adds in a markdown-it plugin that I implemented called markdown-it-fence-line-numbers to restore this functionality to Ghost's Markdown cards.

@coreyasmith coreyasmith force-pushed the markdown-code-fence-line-numbers branch from 83e9ea2 to 1e99d12 Compare October 10, 2024 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant