MCPcopy
hub / github.com/josdejong/mathjs / _toHTML

Method _toHTML

src/expression/node/IndexNode.js:207–222  ·  view source on GitHub ↗

* Get HTML representation * @param {Object} options * @return {string} str

(options)

Source from the content-addressed store, hash-verified

205 * @return {string} str
206 */
207 _toHTML (options) {
208 // format the parameters like "[1, 0:5]"
209 const dimensions = []
210 for (let i = 0; i < this.dimensions.length; i++) {
211 dimensions[i] = this.dimensions[i].toHTML()
212 }
213 if (this.dotNotation) {
214 return '<span class="math-operator math-accessor-operator">.</span>' +
215 '<span class="math-symbol math-property">' +
216 escape(this.getObjectProperty()) + '</span>'
217 } else {
218 return '<span class="math-parenthesis math-square-parenthesis">[</span>' +
219 dimensions.join('<span class="math-separator">,</span>') +
220 '<span class="math-parenthesis math-square-parenthesis">]</span>'
221 }
222 }
223
224 /**
225 * Get LaTeX representation

Callers

nothing calls this directly

Calls 3

getObjectPropertyMethod · 0.95
escapeFunction · 0.90
toHTMLMethod · 0.65

Tested by

no test coverage detected