diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-01-17 22:00:19 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-01-17 22:00:19 -0800 |
commit | b34e19cd2f32342fafd6ae76de4e537240784f71 (patch) | |
tree | 38c19f2dcd14948eda23f859633df8ca0ff750bf | |
parent | 7b0feef72f8dd6e6d1ea61e70272fb826202e820 (diff) |
Renamed DocParser -> Parser.
Note: library users should update their code or it will break.
-rw-r--r-- | dingus.html | 2 | ||||
-rw-r--r-- | js/README.md | 2 | ||||
-rw-r--r-- | js/bench.js | 6 | ||||
-rwxr-xr-x | js/bin/commonmark | 2 | ||||
-rw-r--r-- | js/lib/blocks.js | 8 | ||||
-rwxr-xr-x | js/lib/index.js | 4 | ||||
-rwxr-xr-x | js/test.js | 2 |
7 files changed, 13 insertions, 13 deletions
diff --git a/dingus.html b/dingus.html index 0cac16d..c8de1fb 100644 --- a/dingus.html +++ b/dingus.html @@ -11,7 +11,7 @@ var writer = new commonmark.HtmlRenderer(); var xmlwriter = new commonmark.XmlRenderer({ sourcepos: true }); -var reader = new commonmark.DocParser(); +var reader = new commonmark.Parser(); function getQueryVariable(variable) { var query = window.location.search.substring(1); diff --git a/js/README.md b/js/README.md index 0d5cf13..0bba0c5 100644 --- a/js/README.md +++ b/js/README.md @@ -52,7 +52,7 @@ could transform emphasis into ALL CAPS. Here's a basic usage example: - var reader = new commonmark.DocParser(); + var reader = new commonmark.Parser(); var writer = new commonmark.HtmlRenderer(); var parsed = reader.parse("Hello *world*"); // parsed is a 'Node' tree var result = writer.render(parsed); // result is a string diff --git a/js/bench.js b/js/bench.js index d1e3384..3493dbb 100644 --- a/js/bench.js +++ b/js/bench.js @@ -1,7 +1,7 @@ var Benchmark = require('benchmark').Benchmark; var suite = new Benchmark.Suite(); var fs = require('fs'); -var sm = require('./lib/index.js'); +var commonmark = require('./lib/index.js'); // npm install showdown var Showdown = require('showdown').converter; // npm install marked @@ -15,8 +15,8 @@ var contents = fs.readFileSync(benchfile, 'utf8'); suite.add('commonmark.js markdown->html', function() { "use strict"; - var doc = new sm.DocParser().parse(contents); - var renderer = new sm.HtmlRenderer(); + var doc = new commonmark.Parser().parse(contents); + var renderer = new commonmark.HtmlRenderer(); renderer.render(doc); }) diff --git a/js/bin/commonmark b/js/bin/commonmark index f6e630b..629cd50 100755 --- a/js/bin/commonmark +++ b/js/bin/commonmark @@ -30,7 +30,7 @@ for (i = 2; i < process.argv.length; i++) { } } -var parser = new commonmark.DocParser(options); +var parser = new commonmark.Parser(options); var renderer; if (format === 'html') { diff --git a/js/lib/blocks.js b/js/lib/blocks.js index ce81fd9..476eb28 100644 --- a/js/lib/blocks.js +++ b/js/lib/blocks.js @@ -83,7 +83,7 @@ var stripFinalBlankLines = function(lns) { // DOC PARSER -// These are methods of a DocParser object, defined below. +// These are methods of a Parser object, defined below. // Returns true if parent block can contain child block. var canContain = function(parent_type, child_type) { @@ -679,8 +679,8 @@ var parse = function(input) { }; -// The DocParser object. -function DocParser(options){ +// The Parser object. +function Parser(options){ return { doc: new Document(), tip: this.doc, @@ -702,4 +702,4 @@ function DocParser(options){ }; } -module.exports = DocParser; +module.exports = Parser; diff --git a/js/lib/index.js b/js/lib/index.js index d78a5b2..86eea71 100755 --- a/js/lib/index.js +++ b/js/lib/index.js @@ -7,11 +7,11 @@ // Basic usage: // // var commonmark = require('commonmark'); -// var parser = new commonmark.DocParser(); +// var parser = new commonmark.Parser(); // var renderer = new commonmark.HtmlRenderer(); // console.log(renderer.render(parser.parse('Hello *world*'))); module.exports.Node = require('./node'); -module.exports.DocParser = require('./blocks'); +module.exports.Parser = require('./blocks'); module.exports.HtmlRenderer = require('./html'); module.exports.XmlRenderer = require('./xml'); @@ -39,7 +39,7 @@ var cursor = { }; var writer = new commonmark.HtmlRenderer(); -var reader = new commonmark.DocParser(); +var reader = new commonmark.Parser(); var results = { passed: 0, |