Hi again :)
When a user enters an URL inside of parenthesis and follows that with a character, the html is incorrect (with excludeTrailingPunctuationFromURLs = true). For example, if you enter Some text… (see http://example.com). the html output is
<p>Some text… (see <a href="http://example.com)">http://example.com)</a>.</p>
The expected output is
<p>Some text… (see <a href="http://example.com">http://example.com</a>).</p>
Thanks and also thanks for resolving the last issue so quickly!
well, this is a hard one to tackle.
Because this is a valid address http://example.com/foo), albeit strange.
The only way to know whether the trailing parenthesis belongs to the URL or not is by context.
So I will need to think about this issue for a bit.
Minor update: The issue is not forgotten, but I haven't figure out an efficient way of doing this...
I have a partial fix: It trims the url of punctuation marks. Example:
Cool site (see http://example.com).!?;,
<p>Cool site (see <a href="http://example.com">http://example.com</a>).!?;,</p>
but it fails in this case
For a cool site see http://example.com/(cool_site).
<p>For a cool site see <a href="http://example.com">http://example.com/(cool_site</a>).</p>
In https://github.com/showdownjs/showdown/issues/560 I've described how a reasonable compromise may be done: If (is mentioned in the URL match ) at the end as "inside URL", otherwise don't.
Should be fixed now.
@jendewalt @rugk Can you test please? Let me know if it worked for you.
Donate
As you know, ShowdownJS is a free library and it will remain free forever. However, maintaining and improving the library costs time and money.
If you like our work and find our library useful, please donatethrough Pledgie ordirectly through paypal!! Your contribution will be greatly appreciated and help us continue to develop this awesome library.
Most helpful comment
Should be fixed now.
@jendewalt @rugk Can you test please? Let me know if it worked for you.