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

Chore: update blogpost template #12154

Merged
merged 1 commit into from Aug 26, 2019
Merged

Chore: update blogpost template #12154

merged 1 commit into from Aug 26, 2019

Conversation

mysticatea
Copy link
Member

What is the purpose of this pull request? (put an "X" next to item)

[X] Other, please explain: update the template to post blogs.

What changes did you make? (Give an overview)

This PR updates templates/blogpost.md.ejs to recognize eslint/rfcs#123-like links. This will prevent to make wrong links like:

Is there anything you'd like reviewers to focus on?

Nothing in particular.

@mysticatea mysticatea added the chore This change is not user-facing label Aug 23, 2019
@@ -14,7 +14,7 @@ const RULE_REGEX = new RegExp(`\`?\\b(${ruleList.join("|")})\\b\`?`, "g");

function linkify(line) {
return line
.replace(/#(\d+)/g, "[#$1](https://github.com/eslint/eslint/issues/$1)")
.replace(/([^\s/]+[/][^\s/]+)?#(\d+)/g, (_, repo, num) => `[${repo || ""}#${num}](https://github.com/${repo || "eslint/eslint"}/issues/${num})`)
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, it's tough to read those RegExp. Since the first group is optional, wouldn't repo variable contain ticket number if repo is not present?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, repo will be undefined if repo is not present.

Copy link
Member

@kaicataldo kaicataldo 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!

@kaicataldo kaicataldo merged commit 77f8ed1 into master Aug 26, 2019
@kaicataldo
Copy link
Member

Thanks for contributing to ESLint!

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 23, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 23, 2020
@mysticatea mysticatea deleted the rfc-links branch April 14, 2020 09:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion chore This change is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants