Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Enhancement: allow usage of custom Pygments styles in Code (#980)

Wieland Schöbl216df5380ed5
diff --git a/manim/mobject/svg/code_mobject.py b/manim/mobject/svg/code_mobject.py
index 1e20cc099..f695c2b88 100644
--- a/manim/mobject/svg/code_mobject.py
+++ b/manim/mobject/svg/code_mobject.py
@@ -206,7 +206,8 @@ class Code(VGroup):
raise ValueError(
"Neither a code file nor a code string have been specified."
)
- self.style = self.style.lower()
+ if isinstance(self.style, str):
+ self.style = self.style.lower()
self.gen_html_string()
strati = self.html_string.find("background:")
self.background_color = self.html_string[strati + 12 : strati + 19]