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

Adds parsing for highlighting lines in code blocks #1

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

Conversation

jonsgreen
Copy link

  • extracts line numbers from parentheses placed after language for
    fenced code blocks using regex matching
  • passes line number for each code block to the HTML converter and
    syntax highter using Kramdown root options :line_numbers array stack
  • adds HTMLLineHighligherDelegator to setup the HTMLLineHighlighter
    initialization with the needed Rouge::Formatters::HTML first argument
  • patches Kramdown::Converter::SyntaxHighlighter::Rouge by reopening the
    module and adding the highlight_lines option

- extracts line numbers from parentheses placed after language for
  fenced code blocks using regex matching
- passes line number for each code block to the HTML converter and
  syntax highter using  Kramdown root options :line_numbers array stack
- adds HTMLLineHighligherDelegator to setup the HTMLLineHighlighter
  initialization with the needed Rouge::Formatters::HTML first argument
- patches Kramdown::Converter::SyntaxHighlighter::Rouge by reopening the
  module and adding the highlight_lines option
@jonsgreen jonsgreen marked this pull request as draft July 22, 2022 02:36
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