Files
test-repo/tests_integration/plugins/preprocess/plugin.js
T
Marcel Jackwerth a27d19b2c1 Allow Plugins to preprocess text (#3664)
* Allow Plugins to preprocess text

* Actually pull up text

* Always expect the preprocessor to set the text

* Add tests for preprocessing

* Remove unused variable
2018-01-10 00:27:26 +11:00

25 lines
405 B
JavaScript

"use strict";
module.exports = {
languages: [
{
name: "foo",
parsers: ["foo-parser"],
extensions: [".foo"],
since: "1.0.0"
}
],
parsers: {
"foo-parser": {
preprocess: text => `preprocessed:${text}`,
parse: text => ({ text }),
astFormat: "foo-ast"
}
},
printers: {
"foo-ast": {
print: path => path.getValue().text
}
}
};