Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links with markdown formatting in (eg underscores) are interpreted as markdown #4674

Closed
dbkr opened this issue Jul 25, 2017 · 13 comments · Fixed by matrix-org/matrix-react-sdk#7200 or matrix-org/matrix-react-sdk#7257
Assignees
Labels
A-Composer O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect X-Regression Z-Mozilla

Comments

@dbkr
Copy link
Member

dbkr commented Jul 25, 2017

eg. type http://domain.xyz/foo/bar-_stuff-like-this_-in-it.jpg in markdown mode, it ends up as a link with italics instead of the underscores

@dbkr dbkr changed the title links with markdown formatting in (eg underscores) are interpreted as markdown eg. type http://domain.xyz/foo/bar-stuff-like-this-in-it.jpg in markdown mode, it ends up as a link with italics instead of the underscores links with markdown formatting in (eg underscores) are interpreted as markdown Jul 25, 2017
@lampholder lampholder added the P1 label Aug 2, 2017
@lukebarnard1
Copy link
Contributor

lukebarnard1 commented Aug 3, 2017

Plan of action is to RegExp URLs prior to markdown parsing to make them [url](url)-style md links. This should really use linkify-js, the thing we use to turn URLs into <a>s in the timeline, but unfortunately it doesn't have an API for replacing a URL with an arbitrary string.

@ara4n
Copy link
Member

ara4n commented Jan 7, 2018

#1270 introduced #4809 and has been reverted; unfortunately this means that this is open again. #4809 has much discussion over possible better fixes, but the TL;DR is:

  • Either we change back to GFM
  • Or we patch commonmark to behave like GFM (and create a horrible custom MD dialect)
  • Or we write an adhoc parser which goes through and finds things which look like non-code blocks and try to linkify them and then MD-escape them
  • Or we take commonmark's AST and try to guess where commonmark has got it wrong and then modify the AST to remove the spurious italics etc.

@ara4n
Copy link
Member

ara4n commented Feb 7, 2018

twinned with #3428

@bhearsum
Copy link

At the risk of piling on, this is especially annoying if you commonly link to python code -- where __init__.py is a common file name.

@MadLittleMods MadLittleMods changed the title links with markdown formatting in (eg underscores) are interpreted as markdown Links with markdown formatting in (eg underscores) are interpreted as markdown Sep 3, 2021
@kittykat
Copy link
Contributor

kittykat commented Nov 4, 2021

Can confirm that this is still valid:

Screenshot from 2021-11-04 09-28-32

@kittykat kittykat added O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience and removed P1 labels Nov 4, 2021
@novocaine novocaine added S-Minor Impairs non-critical functionality or suitable workarounds exist and removed S-Major Severely degrades major functionality or product features, with no satisfactory workaround labels Nov 5, 2021
@Palid Palid self-assigned this Nov 16, 2021
@babolivier
Copy link
Contributor

babolivier commented Dec 1, 2021

I'm using latest develop (f496d6d5bf31-react-4a6d46b76adc-js-87b920698f4c, which according to https://github.com/matrix-org/matrix-react-sdk/commits/4a6d46b76adc includes the fix from matrix-org/matrix-react-sdk#7200) and this issue still persists:

image

(this is when pasting https://github.com/matrix-org/synapse/blob/develop/synapse/module_api/__init__.py into the composer)

So I think this issue needs reopening.

@babolivier babolivier reopened this Dec 2, 2021
Palid pushed a commit to matrix-org/matrix-react-sdk that referenced this issue Dec 2, 2021
dbkr pushed a commit to matrix-org/matrix-react-sdk that referenced this issue Dec 2, 2021
* Fix markdown formatting for bold

Fix element-hq/element-web#4674

* I hate you too eslint
@Palid
Copy link
Contributor

Palid commented Dec 2, 2021

@babolivier thanks for catching, fixed in matrix-org/matrix-react-sdk#7257 😄

@babolivier
Copy link
Contributor

Can confirm it works great now, thanks a lot @Palid! 😁

@hho
Copy link

hho commented Dec 6, 2021

Should this work in

Element version: 1.9.6
Olm version: 3.2.3

now?

Because, for me it still doesn't:

My test URL is https://www.bora.com/fileadmin/_processed_/5/e/csm_Headerbild_BORA_Classic_2_L_e8dfdf2889.jpg.webp

It get's rendered as https://www.bora.com/fileadmin/processed/5/e/csm_Headerbild_BORA_Classic_2_L_e8dfdf2889.jpg.webp instead.

@t3chguy
Copy link
Member

t3chguy commented Dec 6, 2021

This fix is on develop, not yet in a release. Be patient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Composer O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect X-Regression Z-Mozilla
Projects
None yet