(math, doc)
| 1 | // Makes text selectable |
| 2 | MathJax = { |
| 3 | addCopyText(math, doc) { |
| 4 | if (math.state() < MathJax.STATE.ADDTEXT) { |
| 5 | if (!math.isEscaped) { |
| 6 | const adaptor = doc.adaptor; |
| 7 | const text = adaptor.node('span', {'aria-hidden': true, 'class': 'mathjax_ignore mjx-copytext'}, [ |
| 8 | adaptor.text(math.start.delim + math.math + math.end.delim) |
| 9 | ]); |
| 10 | adaptor.append(math.typesetRoot, text); |
| 11 | // Insert thin space(s) if math is at begin or end of text |
| 12 | if (math.start.n == 0) { |
| 13 | adaptor.insert(adaptor.text('\u200A'), adaptor.firstChild(math.typesetRoot)); |
| 14 | } |
| 15 | if (math.end.n == math.end.node.length) { |
| 16 | adaptor.append(math.typesetRoot, adaptor.text('\u200A')); |
| 17 | } |
| 18 | } |
| 19 | math.state(MathJax.STATE.ADDTEXT); |
| 20 | } |
| 21 | }, |
| 22 | startup: { |
| 23 | ready() { |
| 24 | const {newState, STATE} = MathJax._.core.MathItem; |
nothing calls this directly
no outgoing calls
no test coverage detected