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

Support html subset from Matrix #9

Closed
binarious opened this issue Jul 31, 2022 · 7 comments · Fixed by #14
Closed

Support html subset from Matrix #9

binarious opened this issue Jul 31, 2022 · 7 comments · Fixed by #14
Assignees
Labels
enhancement New feature or request in work first testing version on top of main

Comments

@binarious
Copy link

Is your feature request related to a problem? Please describe.
Using Markdown (like **bold** text or [My Link](https://myurl.com)) results in plain text instead of a Markdown interpreted message.

Describe the solution you'd like
It would be great to have the message Markdown interpreted.

@oelison oelison added the enhancement New feature or request label Jul 31, 2022
@oelison
Copy link
Owner

oelison commented Aug 9, 2022

In the matrix protocol only html is defined. And also only a subset.
So what I could assume is to open an interface for html messages. The results will be very different on each client. So it is on the users side to try out what is working.
Element for example is converting the markdown input into html. You could see the result when you look at the code of a send message. But it looks very complex. Please give a comment on the approach.

@oelison
Copy link
Owner

oelison commented Aug 9, 2022

@oelison
Copy link
Owner

oelison commented Aug 9, 2022

{
  "type": "m.room.message",
  "sender": "@abcde:abcde.de",
  "content": {
    "body": "test **with mark down**",
    "msgtype": "m.text",
    "format": "org.matrix.custom.html",
    "formatted_body": "test <strong>with mark down</strong>"
  },
  "origin_server_ts": 13242342316,
  "unsigned": {
    "age": 1
  },
  "event_id": "$AAAAAAAAAAAAAAA_A_AAAAA-AAAAAAAAAAAAAAA",
  "room_id": "!AAAAAAAAAAAAA:abcde.de"
}

@binarious
Copy link
Author

I see. Didn't know that. HTML support would be nice then, if that's feasable. Shall I rename the issue?

@oelison oelison changed the title Support Markdown Support html subset from Matrix Aug 10, 2022
@oelison
Copy link
Owner

oelison commented Aug 10, 2022

I have renamed it.

oelison added a commit that referenced this issue Aug 10, 2022
* README.md with examples for html
* html implementation "format": "org.matrix.custom.html"

#9 Support html subset from Matrix
@oelison oelison added the in work first testing version on top of main label Aug 10, 2022
@oelison oelison self-assigned this Aug 10, 2022
@oelison
Copy link
Owner

oelison commented Aug 10, 2022

Looks fine. See one result copied into #test-ioBroker-adapter:matrix.org

@binarious
Copy link
Author

binarious commented Aug 12, 2022

I just see 12ab as an unformatted message in Element on Android.

Edit: Just read the updated Readme which clearly states that as the expected result.
Edit 2: Looks good on Element Web. 🎉

oelison added a commit that referenced this issue Aug 12, 2022
* README.md with examples for html
* html implementation "format": "org.matrix.custom.html"

#9 Support html subset from Matrix
@oelison oelison linked a pull request Aug 12, 2022 that will close this 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 in work first testing version on top of main
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants