-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic test for running markdown with separate parse and render calls.
- Loading branch information
Showing
3 changed files
with
106 additions
and
200 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
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,23 @@ | ||
chai = require 'chai' | ||
expect = chai.expect | ||
### eslint-env node, mocha ### | ||
|
||
markdownit = require 'markdown-it' | ||
plugin = require '../../src/plugin' | ||
|
||
describe "graph", -> | ||
|
||
describe.only "base", -> | ||
|
||
it "should work without plugin", -> | ||
md = markdownit().use plugin | ||
result = md.render "# Heading" | ||
expect(result).to.equal('<h1>Heading</h1>\n') | ||
|
||
it "should work using extra renderer call", -> | ||
md = markdownit().use plugin | ||
env = {} | ||
tokens = md.parse "# Heading", env | ||
console.log tokens | ||
result = md.renderer.render tokens, md.options, env | ||
expect(result).to.equal('<h1>Heading</h1>\n') |