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):
404404 # print(self.default_color,self.background_color)
405405 for i in range (3 , - 1 , - 1 ):
406406 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+
407412 for i in range (10 , - 1 , - 1 ):
408413 self .html_string = self .html_string .replace (
409414 "</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