double underscore bold formatting takes precedence over automatic url formatting

I searched both CE and EE issue trackers but I didn't see a duplicate for this, I apologize if that is not the case.

Summary

When putting a url in a comment which contains multiple __, the url is prematurely ended in order to format the text between them as bold. For example:

https://gitlab.com/pycqa/flake8/blob/master/src/flake8/init.py#L1 (this will render correctly when this is fixed)

https://gitlab.com/pycqa/flake8/blob/master/src/flake8/__init__.py#L1 should be a single url with the __ preserved in the url.

At the time of writing this, the above url instead looks something like <a>https://gitlab.com/pycqa/flake8/blob/master/src/flake8/</a><bold>init</bold>.py#L1 and the actual href is also wrong, not just the rendering of it.

Steps to reproduce

Put a url containing more than one set of __ with text between them in a comment and post it.

Example Project

The link above to a file in pycqa/flake8 should be example enough I think.

What is the current bug behavior?

The url is not automatically linked correctly, instead it ends where the formatting begins.

What is the expected correct behavior?

The url should be complete, and the formatting behavior of the __ should be ignored.

Relevant logs and/or screenshots

Here is a screenshot of the incorrect rendering:

Screen_Shot_2017-10-20_at_9.07.51_AM

Output of checks

This bug happens on GitLab.com.

Possible fixes

I don't have any insight into where this might be fixed, but I imagine it comes down to automatic url creation needs to take precedence over text formatting, or that urls need to be excluded from text formatting.

Edited by William Woodall