Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 59 additions & 48 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
},
"homepage": "https://github.com/couchbase-examples/couchbase-tutorials#readme",
"dependencies": {
"cheerio": "^1.1.2",
"cheerio": "^1.2.0",
"fs": "^0.0.1-security",
"js-yaml": "^4.1.0",
"marked": "^17.0.1",
"js-yaml": "^5.2.1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Upgrading js-yaml to v5.x introduces a breaking change where yaml.load() throws a YAMLException when parsing empty or whitespace-only sources (whereas v4.x safely returned undefined or null).

In utils/extract_frontmatter_from_tutorial.js, the extractFrontmatterFromContent function passes the extracted frontmatter match directly to yaml.load(match[1]). If a markdown file contains empty frontmatter (e.g., --- followed immediately by ---), match[1] will be an empty string "". Under js-yaml v5.x, this will throw an exception and crash the validation script (test-markdown-frontmatter.js).

To prevent this, either revert to js-yaml ^4.1.0 or update utils/extract_frontmatter_from_tutorial.js to guard against empty/whitespace-only frontmatter before calling yaml.load().

Suggested change
"js-yaml": "^5.2.1",
"js-yaml": "^4.1.0",

"marked": "^18.0.5",
"path": "^0.12.7"
},
"devDependencies": {
Expand Down
Loading