Skip to content
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

Merged
merged 1 commit into from
Oct 18, 2018

Conversation

tolmasky
Copy link
Contributor

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 )

@jsf-clabot
Copy link

jsf-clabot commented Oct 15, 2018

CLA assistant check
All committers have signed the CLA.

tolmasky added a commit to runkit-forks/eslint-plugin-markdown that referenced this pull request Oct 15, 2018
@tolmasky tolmasky force-pushed the multiple-language branch 7 times, most recently from 4749455 to 4fe4054 Compare October 17, 2018 00:14
Copy link
Member

@btmills btmills left a 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",
Copy link
Member

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 😈

Copy link
Member

@btmills btmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @tolmasky!

@btmills btmills merged commit a5d0cce into eslint:master Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should ignore lang string after the first space
3 participants