-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for paragraphs as a top-level production
This changes the API to export `list` and `paragraph` methods, which are now documented in the README.
- Loading branch information
Showing
27 changed files
with
57 additions
and
12 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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
'use strict'; | ||
var parser = require('./generated-parser.js'); | ||
|
||
module.exports = function translate(ecmarkdown) { | ||
return parser.parse(ecmarkdown.trim() + '\n'); | ||
exports.list = function (ecmarkdown) { | ||
return parser.parse(ecmarkdown.trim() + '\n', { startRule: 'list' }); | ||
}; | ||
|
||
exports.paragraph = function (ecmarkdown) { | ||
return parser.parse(ecmarkdown.trim(), { startRule: 'paragraph' }); | ||
}; |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
*beginning* value |
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 @@ | ||
<p><emu-val>beginning</emu-val> value</p> |
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 |
---|---|---|
@@ -1,10 +1,21 @@ | ||
'use strict'; | ||
var path = require('path'); | ||
var baselineTester = require('baseline-tester'); | ||
var generate = require('..'); | ||
var Bluebird = require('bluebird'); | ||
var baselineTester = Bluebird.promisify(require('baseline-tester')); | ||
var ecmarkdown = require('..'); | ||
|
||
baselineTester(generate, { | ||
casesDirectory: path.resolve(__dirname, 'cases'), | ||
inputExtension: 'ecmarkdown', | ||
outputExtension: 'html' | ||
}); | ||
Bluebird.try(function () { | ||
return baselineTester(ecmarkdown.list, { | ||
casesDirectory: path.resolve(__dirname, 'list-cases'), | ||
inputExtension: 'ecmarkdown', | ||
outputExtension: 'html' | ||
}); | ||
}) | ||
.then(function () { | ||
return baselineTester(ecmarkdown.paragraph, { | ||
casesDirectory: path.resolve(__dirname, 'paragraph-cases'), | ||
inputExtension: 'ecmarkdown', | ||
outputExtension: 'html' | ||
}); | ||
}) | ||
.done(); |