Skip to content

Commit

Permalink
fix: lazily match delimited title (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatiusmb committed Jan 17, 2024
1 parent f8cb56b commit d1ed448
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion workspace/marqua/src/artisan/marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ marker.renderer.rules.heading_open = scope(() => {
const [token, text] = [tokens[idx], tokens[idx + 1].content];
const level = +token.tag.slice(-1);
if (level > 4) return `<${token.tag}>`;
const [delimited] = text.match(/\$\(.*\)/) || [''];
const [delimited] = text.match(/\$\(.*?\)/) || [''];
const id = generate.id(delimited.slice(2, -1) || text);

if (level === 2) parents = [id];
Expand Down
2 changes: 1 addition & 1 deletion workspace/marqua/src/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function parse(source) {
if (!match) continue;

const [, hashes, title] = match;
const [delimited] = title.match(/\$\(.*\)/) || [''];
const [delimited] = title.match(/\$\(.*?\)/) || [''];

table.push({
id: generate.id(delimited.slice(2, -1) || title),
Expand Down

1 comment on commit d1ed448

@vercel
Copy link

@vercel vercel bot commented on d1ed448 Jan 17, 2024

Choose a reason for hiding this comment

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

Please sign in to comment.