Jump to navigation

Class: DOMcontentsubber

Numbas.jme.variables.DOMcontentsubber

new DOMcontentsubber(scope)

An object which substitutes JME values into HTML. JME expressions found inside text nodes are evaluated with respect to the given scope.

Parameters:
Name Type Description
scope Numbas.jme.Scope
Source:

Methods

findvars(element) → {Array.<string>}

Find all variables which would be used when substituting into the given HTML node. If the node is an element, use findvars_element; if it's text, use findvars_text.

Parameters:
Name Type Description
element Node
Returns:
Type Description
Array.<string>
Source:

findvars_element(element, scope) → {Array.<string>}

Find all variables which would be used when substituting into the given element.

Parameters:
Name Type Description
element Element
scope Numbas.jme.Scope

The scope to use for normalising names.

Returns:
Type Description
Array.<string>
Source:

subvars(element) → {Element}

Substitute JME values into the given element and any children.

Parameters:
Name Type Description
element Element
Returns:
Type Description
Element
Source: