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

Messages to Matrix get markdown formatted #1022

Closed
Mikaela opened this issue Mar 3, 2020 · 9 comments
Closed

Messages to Matrix get markdown formatted #1022

Mikaela opened this issue Mar 3, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@Mikaela
Copy link

Mikaela commented Mar 3, 2020

Describe the bug

When a message is sent from e.g. XMPP or IRC that is accidentally markdown, Matrix receives the message markdownified. This is especially distruptive when sending code or links that happen to contain underscores.

To Reproduce

Demo instance: Send a message beginning with # on https://t.me/Matterbridge and watch it become a <h1> on #matterbridge:matrix.org.

Expected behavior

I expect the message to leave and arrive as plaintext without getting strangely interpreted as markdown making the message difficult to read.

Screenshots/debug logs

Telegram

Matrix

Debug log: not applicable

Environment (please complete the following information):

  • OS: Debian GNU/Linux 9.12 (stretch)
  • Matterbridge version: 1.16.5 4be00bb

Additional context

Config file has two IRC networks, one Matrix server, one XMPP server and

[general]
RemoteNickFormat="[{LABEL}] <{NICK}> "
IgnoreFailureOnStart=false
MessageSplit=true

more information available on request, but the configuration or gateways don't seem relevant as I can reproduce this on the support group/room matterbridge.

@Mikaela Mikaela added the bug label Mar 3, 2020
@qaisjp
Copy link
Collaborator

qaisjp commented Mar 3, 2020

If you sent a message starting with # as a normal user on Matrix, would it render as a <h1>? If so, then imo I this should be kept as default behaviour with "no-markdown-rendering" kept behind a setting.

i.e. imo someone on IRC saying One **two** three four should render on other Markdown-supporting platforms as "One two three four"

@Mikaela
Copy link
Author

Mikaela commented Mar 3, 2020

If you sent a message starting with # as a normal user on Matrix, would it render as a <h1>?

Yes and if I send

testing https://www.reddit.com/r/gaming/comments/fcvmfo/can_we_all_agree_the_tiger_knee_position_is_the/ top of /r/all

it will be

testing https://www.reddit.com/r/gaming/comments/fcvmfo/can_we_all_agree_the_tiger_knee_position_is_the/ top of /r/all

but if it's send through matterbridge it's suddenly

testing https://www.reddit.com/r/gaming/comments/fcvmfo/canweallagreethetigerkneepositionis_the/ top of /r/all

Reddit is a bid bad example as it recognises that ID fcvmfo causing the link to still work, but I imagine it would break in many other situations.


Edit: a better example is Test including Wikipedia's article of the day with a heading with multiworded subtitle: https://en.wikipedia.org/wiki/Tourette_syndrome#Psychoeducation_and_social_support which Matterbridge turns into

kuva

which file redirecting to the correct page, loses the anchor information. The preview below suffers the same issue.

@42wim
Copy link
Owner

42wim commented Mar 14, 2020

@Mikaela your last issue with the underscores is already fixed in master a while ago.
Could you run matterbridge dev build? https://bintray.com/beta/#/42wim/nightly/Matterbridge/v1.16.5-30-g6b4b191?tab=files

@42wim
Copy link
Owner

42wim commented Mar 22, 2020

@Mikaela or run v1.17.0 which is now out

@42wim 42wim added the waiting for feedback Further information is requested label Mar 22, 2020
@Mikaela
Copy link
Author

Mikaela commented Mar 23, 2020

Sorry, I missed your previous comment 9 days ago, but yes, link handling seems to now be fixed. Thank you 💜

I still wish I could disable the rest of the markdown though.

@Mikaela
Copy link
Author

Mikaela commented Apr 7, 2020

Some issues I have noticed today and that have caused headscratching:

  • XMPP sending e.g. </sarcasm> to Matrix results an empty message unless the Matrix user looks into message source.
  • Sending a list of things to do from IRC:
1. have more caffeine
2. do something
3. do something more

results into Matrix having everything labeled as 1. as matterbridge converts plaintext-IRC to markdown unexpectedly. I imagine there are other scenarios where this confusion arises from incorrectly formatted messages.

@Mikaela
Copy link
Author

Mikaela commented May 13, 2020

Mathematics from Telegram to Matrix are also interesting.

https://t.me/Piraattinuoret/15904

photo_2020-05-13_21-42-20

@42wim 42wim added enhancement New feature or request and removed bug waiting for feedback Further information is requested labels May 13, 2020
@42wim 42wim closed this as completed in d44598a May 13, 2020
@42wim
Copy link
Owner

42wim commented May 13, 2020

HTMLDisable option is now available in master.

@bkil
Copy link

bkil commented Jan 31, 2021

Thanks for the feature. I wanted to enable just this, but I've ran into an issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants