Skip to content

Commit 4a7395b

Browse files
authored
Fix TeX usage example
1 parent 7e2d4af commit 4a7395b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,14 +804,15 @@ Then, use the `customRender` parameter to add the widget to render Tex. It could
804804
Widget htmlWidget = Html(
805805
data: r"""<tex>i\hbar\frac{\partial}{\partial t}\Psi(\vec x,t) = -\frac{\hbar}{2m}\nabla^2\Psi(\vec x,t)+ V(\vec x)\Psi(\vec x,t)</tex>""",
806806
customRender: {
807-
"tex": (_, __, ___, element) => Math.tex(
808-
element.text,
807+
"tex": (RenderContext context, _) => Math.tex(
808+
context.tree.element!.text,
809809
onErrorFallback: (FlutterMathException e) {
810810
//return your error widget here e.g.
811811
return Text(e.message);
812812
},
813813
),
814-
}
814+
},
815+
tagsList: Html.tags..add('tex'),
815816
);
816817
```
817818

0 commit comments

Comments
 (0)