We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In previous versions 5.0.3, when rendering a Label widget, the text would be renderer. However in the latest version it is not renderer.
5.0.3
import ipywidgets as widgets widgets.Label(value='Label Widget')
The label should be rendered
Sorry, but I do not think the rest is necessary, hence skipping that. Its pretty easy to see whats going on here, see below
window.MathJax
undefined
latexTypesetter
typeset(element: HTMLElement, text?: string): void { this.displayed.then(() => { if ((window as any).MathJax?.Hub?.Queue) { return typeset(element, text); } const widget_manager: any = this.model.widget_manager; const latexTypesetter = widget_manager._rendermime?.latexTypesetter; if (latexTypesetter) { if (text !== void 0) { element.textContent = text; } latexTypesetter.typeset(element); } }); }
Note: The typeset function in utils.ts will already check whether MathJax is available. Hence there's no need to test the availability.
typeset
utils.ts
export function typeset(element: HTMLElement, text?: string): void { if (text !== void 0) { element.textContent = text; } if ((window as any).MathJax !== void 0) { MathJax!.Hub!.Queue(['Typeset', MathJax.Hub, element]); } }
I think the right fix is
typeset(element: HTMLElement, text?: string): void { this.displayed.then(() => { const widget_manager: any = this.model.widget_manager; const latexTypesetter = widget_manager._rendermime?.latexTypesetter; if (latexTypesetter) { if (text !== void 0) { element.textContent = text; } latexTypesetter.typeset(element); } else { return typeset(element, text); } }); }
Previously it used to be this.displayed.then(() => typeset(element, text)); The change was introduced in this commit (basically there's never a fallback if either one is not present) 388c782#diff-5cc2749aa43c522b3c6b9485d1c9f7b93df1536d43c18ca94553f3a55f70b03fL69
this.displayed.then(() => typeset(element, text));
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Description
In previous versions
5.0.3
, when rendering a Label widget, the text would be renderer.However in the latest version it is not renderer.
Reproduce
Expected behavior
The label should be rendered
Context
Sorry, but I do not think the rest is necessary, hence skipping that.
Its pretty easy to see whats going on here, see below
window.MathJax
isundefined
latexTypesetter
is alsoundefined
Note:
The
typeset
function inutils.ts
will already check whether MathJax is available.Hence there's no need to test the availability.
I think the right fix is
Previously it used to be
this.displayed.then(() => typeset(element, text));
The change was introduced in this commit (basically there's never a fallback if either one is not present)
388c782#diff-5cc2749aa43c522b3c6b9485d1c9f7b93df1536d43c18ca94553f3a55f70b03fL69
The text was updated successfully, but these errors were encountered: