mirror of
https://github.com/cheat/cheat.git
synced 2025-09-06 03:52:55 +02:00
Minor revisions on #244
- When using GFM code fences, strip the last line in addition to the first - Updated `README.md` to mention the new feature - `minor` version-bump to `2.2.0`.
This commit is contained in:
@ -21,9 +21,9 @@ def colorize(sheet_content):
|
||||
return sheet_content
|
||||
|
||||
first_line = sheet_content.splitlines()[0]
|
||||
lexer = get_lexer_by_name('bash')
|
||||
lexer = get_lexer_by_name('bash')
|
||||
if first_line.startswith('```'):
|
||||
sheet_content = '\n'.join(sheet_content.split('\n')[1:])
|
||||
sheet_content = '\n'.join(sheet_content.split('\n')[1:-2])
|
||||
try:
|
||||
lexer = get_lexer_by_name(first_line[3:])
|
||||
except Exception:
|
||||
|
Reference in New Issue
Block a user