File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -404,6 +404,11 @@ def _gen_code_json(self):
404
404
# print(self.default_color,self.background_color)
405
405
for i in range (3 , - 1 , - 1 ):
406
406
self .html_string = self .html_string .replace ("</" + " " * i , "</" )
407
+
408
+ # handle pygments bug
409
+ # https://github.com/pygments/pygments/issues/961
410
+ self .html_string = self .html_string .replace ("<span></span>" , "" )
411
+
407
412
for i in range (10 , - 1 , - 1 ):
408
413
self .html_string = self .html_string .replace (
409
414
"</span>" + " " * i ,
Original file line number Diff line number Diff line change
1
+ from manim .mobject .text .code_mobject import Code
2
+
3
+
4
+ def test_code_indentation ():
5
+ co = Code (
6
+ code = """\
7
+ def test()
8
+ print("Hi")
9
+ """ ,
10
+ language = "Python" ,
11
+ indentation_chars = " " ,
12
+ )
13
+
14
+ assert co .tab_spaces [0 ] == 1
15
+ assert co .tab_spaces [1 ] == 2
You can’t perform that action at this time.
0 commit comments