-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple words in code's language. #99
Conversation
afec86e
to
f5f1162
Compare
4749455
to
4fe4054
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this, @tolmasky, and sorry I didn't see the issue for so long! Implementation looks good. Can you add a test? The attached patch would do the trick:
diff --git a/tests/lib/processor.js b/tests/lib/processor.js
index eeed197..5b15b4d 100644
--- a/tests/lib/processor.js
+++ b/tests/lib/processor.js
@@ -257,6 +257,17 @@ describe("processor", function() {
assert.equal(blocks.length, 1);
});
+ it("should ignore anything after the first word of the info string", function() {
+ var code = [
+ "```js more words are ignored",
+ "var answer = 6 * 7;",
+ "```"
+ ].join("\n");
+ var blocks = processor.preprocess(code);
+
+ assert.equal(blocks.length, 1);
+ });
+
it("should find code fences not surrounded by blank lines", function() {
var code = [
"<!-- eslint-disable -->",
package.json
Outdated
@@ -1,5 +1,5 @@ | |||
{ | |||
"name": "eslint-plugin-markdown", | |||
"name": "eslint-plugin-markdown-runkit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this snuck in 😈
4fe4054
to
0cdae30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @tolmasky!
This fixes #98. I tested this in the node source and it appears to work fine (currently pushed as a forked module to be able to do this test: nodejs/node@6361ed8 )