Skip to content

Commit 3e3df88

Browse files
committed
Update doc string and check for empty text param.
1 parent 5cfd93e commit 3e3df88

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

jupyter-js-widgets/src/utils.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -143,20 +143,19 @@ function reject(message, log) {
143143
}
144144

145145
/**
146-
* Apply MathJax rendering to an element, and optionally set its text
146+
* Apply MathJax rendering to an element, and optionally set its text.
147147
*
148148
* If MathJax is not available, make no changes.
149149
*
150-
* Returns the output any number of typeset elements as an array or undefined if
151-
* MathJax was not available.
152-
*
153150
* Parameters
154151
* ----------
155-
* element: Node, NodeList, or jQuery selection
156-
* text: option string
152+
* element: Node
153+
* text: optional string
157154
*/
158155
function typeset(element, text) {
159-
element.textContent = text;
156+
if (text) {
157+
element.textContent = text;
158+
}
160159
if (window.MathJax) {
161160
MathJax.Hub.Queue(['Typeset', MathJax.Hub, element]);
162161
}

0 commit comments

Comments
 (0)