Support multiple words in code's language.#99
Merged
btmills merged 1 commit intoeslint:masterfrom Oct 18, 2018
Merged
Conversation
4 tasks
afec86e to
f5f1162
Compare
tolmasky
added a commit
to runkit-forks/eslint-plugin-markdown
that referenced
this pull request
Oct 15, 2018
4749455 to
4fe4054
Compare
btmills
suggested changes
Oct 17, 2018
Member
btmills
left a comment
There was a problem hiding this comment.
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", | |||
4fe4054 to
0cdae30
Compare
btmills
approved these changes
Oct 18, 2018
Closed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 )