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: undefined is rendered as link if --no-template is passed #167

Merged
merged 3 commits into from
Aug 6, 2024

Conversation

brc-dd
Copy link
Contributor

@brc-dd brc-dd commented Aug 6, 2024

example - vuejs/vitepress#4100 (comment)

there is also an extra bullet at end in that comment, but I guess it's because #166 isn't released yet?

Copy link
Member

@Aslemammad Aslemammad left a comment

Choose a reason for hiding this comment

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

Huge catch, thank you so much!

@@ -91,7 +91,7 @@ ${templatesStr}

function generateTemplatesStr(templates: Record<string, string>) {
const entries = Object.entries(templates).filter(([k]) => k !== "default");
let str = `[Open in Stackblitz](${templates["default"]})`;
let str = templates["default"] ? `[Open in Stackblitz](${templates["default"]})` : '';

if (entries.length && entries.length <= 2) {
str += ` • ${entries.map(([k, v]) => `[${k}](${v})`).join(" • ")}`;
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove the first dot if the default template is not there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will there be a case when default template is not there but other templates are?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated anyway 😅

Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
Copy link
Member

@Aslemammad Aslemammad left a comment

Choose a reason for hiding this comment

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

Thank you so much for the hard work!

@Aslemammad Aslemammad merged commit eedbbd4 into stackblitz-labs:main Aug 6, 2024
2 of 4 checks passed
@brc-dd brc-dd deleted the fix/undefined-link branch August 6, 2024 13:40
@brc-dd
Copy link
Contributor Author

brc-dd commented Aug 22, 2024

I think this commit was removed from main from one of force pushes? 😅 It's still rendering links as undefined

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants