Vitalije
--
You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sphinx-dev/-/FNq3ko-SwHYJ.
To post to this group, send email to sphin...@googlegroups.com.
To unsubscribe from this group, send email to sphinx-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
If you make your highlight-language python3, then Sphinx won't perform syntax checks before highlighting.
elif lang in ('python3', 'py3') and source.startswith('>>>'):
# for py3, recognize interactive sessions, but do not try parsing...
lexer = lexers['pycon3']
elif lang == 'guess':
...
So it is just that sphinx want check interactive session in python3. Where really comes check is at the end of this method:
# highlight via Pygments
try:
formatter = self.get_formatter(**kwargs)
hlsource = highlight(source, lexer, formatter)
if self.dest == 'html':
return hlsource
else:
return hlsource.translate(tex_hl_escape_map_new)
except ErrorToken:
# this is most probably not the selected language,
# so let it pass unhighlighted
return self.unhighlighted(source)
ie if there is any ErrorToken the whole block won't be highlighted. I am not sure but I think that it wouldn't check if the method add_filter('raiseonerror') of lexer was not called a few lines before this part of method.
Besides, I want my code block written (mostly) in actionscript3 to be highlighted as such not as python3 ;-)
Vitalije