mirror of
https://github.com/3b1b/manim.git
synced 2025-11-15 18:57:46 +00:00
Refactor LabelledString
This commit is contained in:
parent
0a810bb4f1
commit
14dfd776dc
1 changed files with 3 additions and 3 deletions
|
|
@ -135,8 +135,8 @@ class MTex(LabelledString):
|
||||||
if span_begin in brace_indices_dict.keys():
|
if span_begin in brace_indices_dict.keys():
|
||||||
span_end = brace_indices_dict[span_begin] + 1
|
span_end = brace_indices_dict[span_begin] + 1
|
||||||
else:
|
else:
|
||||||
match_obj = self.match(script_pattern, pos=span_begin)
|
span = self.find_spans(script_pattern, pos=span_begin)[0]
|
||||||
if not match_obj:
|
if span[0] != span_begin:
|
||||||
script_name = {
|
script_name = {
|
||||||
"_": "subscript",
|
"_": "subscript",
|
||||||
"^": "superscript"
|
"^": "superscript"
|
||||||
|
|
@ -145,7 +145,7 @@ class MTex(LabelledString):
|
||||||
f"Unclear {script_name} detected while parsing. "
|
f"Unclear {script_name} detected while parsing. "
|
||||||
"Please use braces to clarify"
|
"Please use braces to clarify"
|
||||||
)
|
)
|
||||||
span_end = match_obj.end()
|
span_end = span[1]
|
||||||
result.append((span_begin, span_end))
|
result.append((span_begin, span_end))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue