Skip to content

Commit e3b79aa

Browse files
committed
I think this should work, but I haven't figured out how to test it.
1 parent 20c5062 commit e3b79aa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib/components/script-notes/script-notes.svelte

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
$: {
2121
const lines = notes.split('\n\n')
2222
content = lines.map((line) => {
23+
// regex magic generated by ChatGPT: allows escaped '*' characters to be bolded
24+
const boldRegEx = /(?<!\\)\*\*([^*\n\\]*(\\.[^*\n\\]*)*)\*\*(?!\\)/g
25+
line.replace(boldRegEx, '<strong>$1</strong>')
2326
if (line.startsWith('```') && line.endsWith('```')) {
2427
return {
2528
type: 'code',

0 commit comments

Comments
 (0)