-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1453 from nknapp/master
Do not add "undefined" to the beginning of the result of .fixMarkup()
- Loading branch information
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
let should = require('should'); | ||
let hljs = require('../../build'); | ||
|
||
describe('.fixmarkup()', function() { | ||
after(function() { | ||
hljs.configure({ useBR: false }) | ||
}) | ||
|
||
it('should not add "undefined" to the beginning of the result (#1452)', function() { | ||
hljs.configure({ useBR: true }) | ||
const value = '{ <span class="hljs-attr">"some"</span>: \n <span class="hljs-string">"json"</span> }'; | ||
const result = hljs.fixMarkup(value); | ||
|
||
|
||
result.should.equal( | ||
'{ <span class="hljs-attr">"some"</span>: <br> <span class="hljs-string">"json"</span> }' | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters