ryanguill / roam-tools

simple tools for roamresearch
MIT License
39 stars 4 forks source link

Highlights and bolding parsed incorrectly #11

Open everruler12 opened 4 years ago

everruler12 commented 4 years ago

Example input: - A ** test for **^^**highlights**^^** in bold** and **again** A ** test for ^^highlights^^ in bold**.

Expected output (with default settings): A <strong>test for </strong>==<strong>highlights</strong>==<strong> in bold</strong> and <strong>again</strong> A <strong>test for ==highlights== in bold</strong>.

Actual output (with default settings): A ** test for <strong>==</strong>highlights<strong>^^</strong> in bold** and <strong>again</strong> A ** test for ^^highlights== in bold**. A ** test for ==highlights^^ in bold** and again A ** test for ^^highlights== in bold**.

Suggestion: Use greedy regexp in line 26: return line.replace(/\^\^(.+?)\^\^/gm, `==$1==`);