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

fix(document): do not break the line of the metadata #10129

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

yin1999
Copy link
Member

@yin1999 yin1999 commented Dec 5, 2023

Summary

The content sync tool will finally call the saveFile() function to update the metadata of documents. And it would break the line of the key/value pair in the front-matter. This default behavior conflicts with our front-matter-linter.

see: mdn/translated-content#17266.

Solution

Adding the lineWidth option to resolve this.


How did you test this change?

Using the following script to test the option:

import yaml from "js-yaml";

const options = {
  lineWidth: -1,
  quotingType: '"',
}

console.log(yaml.dump({
  // test long line which breaks into two lines in mdn/translated-content#17266
  "slug": "Web/Media/Audio_and_video_delivery/Adding_captions_and_subtitles_to_HTML5_video",
  "browser-compat": [ // test array
    "api.MessageChannel",
    "api.MessagePort"
  ]
}, options))

@yin1999 yin1999 requested a review from a team as a code owner December 5, 2023 02:39
@github-actions github-actions bot added the idle label Jan 24, 2024
Copy link
Contributor

@argl argl left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@argl argl merged commit 789aa15 into mdn:main Mar 18, 2024
8 checks passed
@yin1999 yin1999 deleted the fix-do-no-line-break branch March 18, 2024 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants