这是我正在尝试做的事情:
this.observableString = ko.observable('When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$');
this.regularString = 'When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$';
};
两者都让我胡言乱语,因为反斜杠在被 MathJax 渲染之前以某种方式被替换了。如果我使用内联文本,它可以工作。如何在不触及反斜杠的情况下保存这些字符串?