Non-informative error message on wrong ```lang-name
slavniyteo opened this issue · 0 comments
slavniyteo commented
Hello.
If I try to view .md file contains code block, defined with wrong language name, it throws exception with low-level message.
Example:
```charp //Some c# code ```
Result:
Traceback (most recent call last):
File "/usr/local/bin/mdv", line 11, in <module>
load_entry_point('mdv==1.6.3', 'console_scripts', 'mdv')()
File "/usr/local/lib/python2.7/dist-packages/mdv-1.6.3-py2.7.egg/mdv/markdownviewer.py", line 1397, in run
print(str(run_args(args)))
File "/usr/local/lib/python2.7/dist-packages/mdv-1.6.3-py2.7.egg/mdv/markdownviewer.py", line 1359, in run_args
tab_length = args.get('-b', 4))
File "/usr/local/lib/python2.7/dist-packages/mdv-1.6.3-py2.7.egg/mdv/markdownviewer.py", line 1149, in main
raw = tags.code(raw.strip(), from_fenced_block=1, lang=lang)
File "/usr/local/lib/python2.7/dist-packages/mdv-1.6.3-py2.7.egg/mdv/markdownviewer.py", line 501, in code
s = style_ansi(raw_code, lang=lang)
File "/usr/local/lib/python2.7/dist-packages/mdv-1.6.3-py2.7.egg/mdv/markdownviewer.py", line 393, in style_ansi
print(col(R, 'Lexer for %s not found' % lang))
File "/usr/local/lib/python2.7/dist-packages/mdv-1.6.3-py2.7.egg/mdv/markdownviewer.py", line 438, in col
if _strt in s:
TypeError: argument of type 'int' is not iterable