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

Parse text to entities with commonmark #11

Merged
merged 5 commits into from
Feb 25, 2021
Merged

Conversation

rnons
Copy link
Collaborator

@rnons rnons commented Feb 23, 2021

Matrix use commonmark as well. See matrix-org/matrix-js-sdk#1425

Somehow this PR doesn't handle this correctly

on Element
image

on Texts
image

The message text contains

`[209876d2](https://github.com/tulir/mautrix-imessage/commit/209876d27c513034adea9cc1475be68327cbbd7e)`

Note the link is wrapped inside a backtick, which is not supported by commonmark and Element as well. Can try on https://spec.commonmark.org/dingus/?text=%60%5B209876d2%5D(https%3A%2F%2Fgit.luolix.top%2Ftulir%2Fmautrix-imessage%2Fcommit%2F209876d27c513034adea9cc1475be68327cbbd7e)%60%0A%0A

@linear
Copy link

linear bot commented Feb 23, 2021

PLT-272 Matrix: map all messages

unrecognized:

{
  "type": "m.room.message",
  "sender": "@github:maunium.net",
  "content": {
    "body": "**[[tulir/mautrix-wsproxy](https://github.com/tulir/mautrix-wsproxy)]** [Yumekui](https://github.com/Yumekui) opened [pull request #1](https://github.com/tulir/mautrix-wsproxy/pull/1): Make binary statically linked instead of dynamically\n \n> Hey,I'm not really experienced with golang, so take that pull request with a grain of salt.I noticed that the docker image didn't work and searched for a solution. The problem appears to be that the binary isn't statically linked and since you use 'FROM scratch' as a base for the image, the required libraries aren't there.After googling a bit, I found this [site](https://www.arp242.net/static-go.html), which recommended to set CGO_ENABLED=0.After building the image locally myself with that, the image seems to work.",
    "format": "org.matrix.custom.html",
    "formatted_body": "<strong>[<a data-mautrix-no-link href=\"https://github.com/tulir/mautrix-wsproxy\">tulir/mautrix-wsproxy</a>]</strong> <a data-mautrix-no-link href=\"https://github.com/Yumekui\">Yumekui</a> opened <a href=\"https://github.com/tulir/mautrix-wsproxy/pull/1\">\n pull request\n #1</a>: Make binary statically linked instead of dynamically<br/>\n <blockquote><p>Hey,\nI'm not really experienced with golang, so take that pull request with a grain of salt.\nI noticed that the docker image didn't work and searched for a solution. The problem appears to be that the binary isn't statically linked and since you use 'FROM scratch' as a base for the image, the required libraries aren't there.\nAfter googling a bit, I found this <a href=\"https://www.arp242.net/static-go.html\">site</a>, which recommended to set CGO_ENABLED=0.\nAfter building the image locally myself with that, the image seems to work.</p>\n</blockquote>",
    "msgtype": "m.notice",
    "xyz.maubot.github.webhook": {
      "delivery_ids": [
        "f3fee820-6ee4-11eb-9f77-19ce04df810c"
      ],
      "event_type": "pull_request"
    }
  },
  "event_id": "$kGu32p6aHuMdqxkEPUBsbqZbdC1OwLspfoWPcL9_iBM",
  "origin_server_ts": 1613321520758,
  "unsigned": {
    "age": 17248294
  },
  "room_id": "!mautrix-imessage-v6:maunium.net"
}

@KishanBagaria KishanBagaria merged commit 3d38b52 into master Feb 25, 2021
@KishanBagaria KishanBagaria deleted the PLT-272/text-entities branch February 25, 2021 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants