mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #4137: doctest: Make doctest and testcode blocks highlighted
This commit is contained in:
parent
de023f2dc0
commit
eebf9d0a0e
2
CHANGES
2
CHANGES
@ -86,6 +86,8 @@ Features added
|
||||
* #4245: html themes: Add ``language`` to javascript vars list
|
||||
* #4079: html: Add ``notranslate`` class to each code-blocks, literals and maths
|
||||
to let Google Translate know they are not translatable
|
||||
* #4137: doctest: doctest block is always highlighted as python console (pycon)
|
||||
* #4137: doctest: testcode block is always highlighted as python
|
||||
|
||||
Features removed
|
||||
----------------
|
||||
|
@ -116,7 +116,11 @@ class TestDirective(Directive):
|
||||
if test is not None:
|
||||
# only save if it differs from code
|
||||
node['test'] = test
|
||||
if self.name == 'testoutput':
|
||||
if self.name == 'doctest':
|
||||
node['language'] = 'pycon'
|
||||
elif self.name == 'testcode':
|
||||
node['language'] = 'python'
|
||||
elif self.name == 'testoutput':
|
||||
# don't try to highlight output
|
||||
node['language'] = 'none'
|
||||
node['options'] = {}
|
||||
|
Loading…
Reference in New Issue
Block a user