imagejan
(Jan Eglinger)
February 11, 2018, 3:32pm
1
I noticed that links containing underscores (_) don’t get oneboxed correctly under certain conditions, because the underscores get interpreted as formatting directives.
Consider this link:
https://github.com/arve0/fijibin/blob/a3d2e983cb9ff2bcbb56a800084bc3b35cb9292f/fijibin/__init__.py#L23
Trying to onebox:
BadZipFile = BadZipfile
__all__ = ['fetch', 'macro']
##
# CONSTANTS
##
VERSION = open(join(dirname(__file__), 'VERSION')).read().strip()
FIJI_VERSION = '20141125'
BASE_URL = 'http://fiji.sc/downloads/Life-Line/fiji-'
END_URL = '-' + FIJI_VERSION + '.zip'
HOME = os.path.expanduser('~')
BIN_FOLDER = join(HOME, '.bin')
EXTRACT_FOLDER = join(BIN_FOLDER, 'Fiji.app')
FIJI_ROOT = join(BIN_FOLDER, 'Fiji-' + FIJI_VERSION + '.app')
BIN_NAMES = {
'Darwin64bit': join(FIJI_ROOT, 'Contents/MacOS/ImageJ-macosx'),
'Linux32bit': join(FIJI_ROOT, 'ImageJ-linux32'),
This can be worked around using %5F to replace the first underscore:
https://github.com/arve0/fijibin/blob/a3d2e983cb9ff2bcbb56a800084bc3b35cb9292f/fijibin/%5F_init__.py#L23
BadZipFile = BadZipfile
__all__ = ['fetch', 'macro']
##
# CONSTANTS
##
VERSION = open(join(dirname(__file__), 'VERSION')).read().strip()
FIJI_VERSION = '20141125'
BASE_URL = 'http://fiji.sc/downloads/Life-Line/fiji-'
END_URL = '-' + FIJI_VERSION + '.zip'
HOME = os.path.expanduser('~')
BIN_FOLDER = join(HOME, '.bin')
EXTRACT_FOLDER = join(BIN_FOLDER, 'Fiji.app')
FIJI_ROOT = join(BIN_FOLDER, 'Fiji-' + FIJI_VERSION + '.app')
BIN_NAMES = {
'Darwin64bit': join(FIJI_ROOT, 'Contents/MacOS/ImageJ-macosx'),
'Linux32bit': join(FIJI_ROOT, 'ImageJ-linux32'),
simply put brackets around it like so
<https://github.com/arve0/fijibin/blob/a3d2e983cb9ff2bcbb56a800084bc3b35cb9292f/fijibin/__init__.py#L23>
Not a bug, auto linking cannot be expected to work in all scenarios. See http://commonmark.org/help for the markdown spec on this
7 Likes
notriddle
(Michael Howell)
February 11, 2018, 8:52pm
3
That doesn’t get oneboxed, either (the percent encoding method seems like the right way to work around this).
2 Likes
imagejan
(Jan Eglinger)
February 12, 2018, 4:34pm
4
I agree with @notriddle : adding the brackets (<>) will keep the link intact, but actually prevents oneboxing in my trials.
1 Like
sam
(Sam Saffron)
February 13, 2018, 6:11am
5
I am half open to allowing oneboxing (but not mini oneboxing) it is quite an edge case though. The bug is in linkify: GitHub - markdown-it/linkify-it: Links recognition library with full unicode support so may be worth mentioning in an issue there.
5 Likes