Closed FelixLisczyk closed 3 years ago
Hey @FelixII this is a great find. Thanks for putting up a fix. The bold fix seems to work fine but the italics fix breaks image parsing. I'm going to have to figure out why that is before merging this in.
Oh yes, you're right. The problem is that the image URL in your sample project (https://upload.wikimedia.org/wikipedia/commons/thumb/1/14/Gatto_europeo4.jpg/250px-Gatto_europeo4.jpg) contains two underscores, which does now trigger the italic parser.
I could try to extend the regex to incorporate this edge case. But maybe it would be an even better option to modify the order of the parsed attributes? This way the more complex patterns would be handled first and wouldn't interfere with the more generic ones.
@FelixII I think that is a good approach. I'll take a look at it today.
I've updated the regex again because they missed some special cases like **a** *b*
. I've also changed the attribute order to resolve the conflict with images.
Closing as this is being addressed in #33
Goals :soccer:
This PR is just a small change to the regex of bold and italic style elements. I've noticed that they don't detect markdown within a word, e.g.
A**B**
will now render correctly as AB.Testing Details :mag:
No tests were added.