-
Notifications
You must be signed in to change notification settings - Fork 42
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
Conversation
There was a problem hiding this 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(" • ")}`; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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>
There was a problem hiding this 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!
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?