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:
Chris Lane
2017-02-28 18:59:27 -05:00
parent 7abb663bf4
commit edd7b5e806
4 changed files with 27 additions and 7 deletions

View File

@ -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: