|
我好像自己解决了这个问题
- <script>
- MathJax = {
- startup: {
- ready: function() {
- const {HTMLDomStrings} = MathJax._.handlers.html.HTMLDomStrings;
- HTMLDomStrings.OPTIONS.includeHtmlTags['mark'] = '';
- var handleTag = HTMLDomStrings.prototype.handleTag;
- HTMLDomStrings.prototype.handleTag = function (node, ignore) {
- if (this.adaptor.kind(node) === 'mark') {
- const text = this.adaptor.textContent(node);
- this.snodes.push([node, text.length]);
- this.string += text;
- }
- return handleTag.call(this, node, ignore);
- }
- MathJax.startup.defaultReady();
- }
- }
- };
- </script>
- <script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
- <mark>x_2</mark> \(x_1+<mark>x_2</mark>+x_3\)
复制代码 |
|