fixmarkup.js 599 B

123456789101112131415161718192021
  1. 'use strict';
  2. let should = require('should');
  3. let hljs = require('../../build');
  4. describe('.fixmarkup()', function() {
  5. after(function() {
  6. hljs.configure({ useBR: false })
  7. })
  8. it('should not add "undefined" to the beginning of the result (#1452)', function() {
  9. hljs.configure({ useBR: true })
  10. const value = '{ <span class="hljs-attr">"some"</span>: \n <span class="hljs-string">"json"</span> }';
  11. const result = hljs.fixMarkup(value);
  12. result.should.equal(
  13. '{ <span class="hljs-attr">"some"</span>: <br> <span class="hljs-string">"json"</span> }'
  14. );
  15. });
  16. });