How to use the @jupyterlab/rendermime.removeMath function in @jupyterlab/rendermime

To help you get started, we’ve selected a few @jupyterlab/rendermime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab / test / src / rendermime / latex.spec.ts View on Github external
it('should handle code spans', () => {
      let input = '`$foo` and `$bar` are variables';
      let { text, math } = removeMath(input);
      expect(text).to.be(input);
      expect(math).to.eql([]);
    });
github jupyterlab / jupyterlab / test / src / rendermime / latex.spec.ts View on Github external
it('should handle begin statements', () => {
      let input = 'hello, \\begin{align} \\end{align}, there';
      let { text, math } = removeMath(input);
      expect(text).to.be('hello, @@0@@, there');
      expect(math).to.eql(['\\begin{align} \\end{align}'])
    });
github jupyterlab / jupyterlab / test / src / rendermime / latex.spec.ts View on Github external
it('should handle unbalanced braces', () => {
      let input = 'hello, $ /alpha { $, there';
      let { text, math } = removeMath(input);
      expect(text).to.be('hello, @@0@@, there');
      expect(math).to.eql(['$ /alpha { $' ])
    });
github jupyterlab / jupyterlab / test / src / rendermime / latex.spec.ts View on Github external
it('should recombine text split with removeMath', () => {
      let input = 'hello, $ /alpha $, there';
      let { text, math } = removeMath(input);
      expect(replaceMath(text, math)).to.be(input);
    });
github jupyterlab / jupyterlab / test / src / rendermime / latex.spec.ts View on Github external
it('should handle math blocks', () => {
      let input = 'hello, $$\nfoo\n$$, there';
      let { text, math } = removeMath(input);
      expect(text).to.be('hello, @@0@@, there');
      expect(math).to.eql(['$$\nfoo\n$$' ])
    });
github jupyterlab / jupyterlab / test / src / rendermime / latex.spec.ts View on Github external
it('should handle balanced braces', () => {
      let input = 'hello, $ /alpha { } $, there';
      let { text, math } = removeMath(input);
      expect(text).to.be('hello, @@0@@, there');
      expect(math).to.eql(['$ /alpha { } $' ])
    });
github jupyterlab / jupyterlab / test / src / rendermime / latex.spec.ts View on Github external
it('should handle math markers', () => {
      let input = ' @@0@@ hello, $ /alpha $, there';
      let { text, math } = removeMath(input);
      expect(text).to.be(' @@0@@ hello, @@1@@, there');
      expect(math).to.eql([ '@@0@@', '$ /alpha $' ])
    });
github jupyterlab / jupyterlab / test / src / rendermime / latex.spec.ts View on Github external
it('should handle `\\\\\[` delimiters for math', () => {
      let input = `hello, \\\\\[
          /alpha
      \\\\\], there`;
      let { text, math } = removeMath(input);
      expect(text).to.be('hello, @@0@@, there');
      expect(math).to.eql(['\\\\[\n          /alpha\n      \\\\]']);
    });