Skip to content

Commit

Permalink
fixed broken compilation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
zehanort committed Oct 16, 2023
1 parent dcae0e3 commit 26a837d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/utils/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,18 @@ export function compileProject(argv: yargs.Arguments): void {
// break second part into id(s) and class(es)
const ids = (parts[2].match(/#[\w-]+/g) || []) as string[];
const classes = (parts[2].match(/\.[\w-]+/g) || []) as string[];
if (ids.length > 1)
if (ids.length > 1) {
console.warn(
`${yellow("Warning:")} snippet link ${yellow(
match
)} has more than one id.`
);
console.warn(
`\tWill only use the first one (${bold(ids[0].slice(1))}).`
);
console.warn(
`\tWill only use the first one (${bold(
ids[0].slice(1)
)}).`
);
}
// return the link
return `<a href="javascript:void(0)" ${
ids.length > 0 ? `id="${ids[0].slice(1)}"` : ""
Expand Down

0 comments on commit 26a837d

Please sign in to comment.