-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: handle markdown-it plugins with options (#207)
- Loading branch information
1 parent
8665948
commit 931711a
Showing
10 changed files
with
118 additions
and
127 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,39 @@ | ||
/* | ||
Copyright the eleventy-plugin-fluid copyright holders. | ||
See the AUTHORS.md file at the top-level directory of this distribution and at | ||
https://github.com/fluid-project/eleventy-plugin-fluid/raw/main/AUTHORS.md. | ||
Licensed under the New BSD license. You may not use this file except in compliance with this License. | ||
You may obtain a copy of the New BSD License at | ||
https://github.com/fluid-project/eleventy-plugin-fluid/raw/main/LICENSE.md. | ||
*/ | ||
"use strict"; | ||
|
||
const test = require("ava"); | ||
const merge = require("@11ty/eleventy/src/Util/Merge.js"); | ||
|
||
test("Passing false replaces an original value", function (t) { | ||
t.deepEqual(merge({browserslist: "> 2%"}, {browserslist: false}), {browserslist: false}); | ||
}); | ||
|
||
test("Passing key with override prefix overrides an original value", function (t) { | ||
t.deepEqual(merge({browserslist: "> 2%"}, {"override:browserslist": "> 1%"}), {browserslist: "> 1%"}); | ||
}); | ||
|
||
test("Nested objects can be merged", function (t) { | ||
t.deepEqual(merge({drafts: {nesting: true}}, {drafts: {customMedia: true}}), {drafts: {nesting: true, customMedia: true}}); | ||
}); | ||
|
||
test("Nested objects can be overriden", function (t) { | ||
t.deepEqual(merge({drafts: {nesting: true}}, {"override:drafts": {customMedia: true}}), {drafts: {customMedia: true}}); | ||
}); | ||
|
||
test("Nested arrays can be merged", function (t) { | ||
t.deepEqual(merge({browserslist: ["ie 8", "ie 9"]}, {browserslist: ["ie 7"]}), {browserslist: ["ie 8", "ie 9", "ie 7"]}); | ||
}); | ||
|
||
test("Nested arrays can be overridden", function (t) { | ||
t.deepEqual(merge({browserslist: ["ie 8", "ie 9"]}, {"override:browserslist": ["ie 7"]}), {browserslist: ["ie 7"]}); | ||
}); |
This file was deleted.
Oops, something went wrong.