I’ve been trying to replace markdown imported in Coda as: *text* or **text**
and then convert it to HTML for italic or bold only.
I worked my way around the italic: text.RegexReplace('\*([^*]+)\*','<i>$1</i>')
"Why is business an infinite game? (4) " → “Why is business an infinite game? <i>(4)</i>”
However, I can’t wrap my head around replacing the bold and doing it without having an overlap of the bold and italic condition since they both contain the * character
Anyone can help a regex noob?
Thank you
UPDATE: I found @Paul_Danyliuk 's regex video which was quite helpful, so now I only have to figure out the bold part. Here’s the link for those interested: Regular Expressions - YouTube
Hey Jay! I’d definitely give Federico’s suggestion a try, but I’d also like to hear more about your workflow. We convert text automatically through the API, so I’m wondering if you are copy/pasting the actual markdown code? If so, where are you copying from? We can pass this feedback along to our product team
I don’t think there’s any bug here, if I copy bold text from the internet it will usually be pasted as bold in Coda. My “importer” wouldn’t work if the content was automatically converted to markdown since I need the characters to be able to replace them