Skip to content

Commit

Permalink
fix(highlight): optional startinline
Browse files Browse the repository at this point in the history
Some languages require a startline (such as `<?php` for PHP).
This forces the snippets to have this startline to be (completly) highlighted.
By setting this option to `True`, the startline becomes optional.
  • Loading branch information
Mesteery authored and Julien00859 committed Apr 18, 2021
1 parent 61e0f09 commit 0bc3f7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/highlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ def _wrap_table(self, inner):

def highlight(code, language):
""" Pretty html export of ``code`` using syntax highlighting """
lexer = get_lexer_by_name(language)
lexer = get_lexer_by_name(language, startinline=True)
return pygments.highlight(code, lexer, _html_formatter)

0 comments on commit 0bc3f7b

Please sign in to comment.