matrix-discord-bridge
matrix-discord-bridge copied to clipboard
Add HTML parser for Matrix messages
Sometimes Matrix messages are more complex and are expressed with HTML markup. This introduces some challenges with bridging such messages to Matrix. Things like spoilers, lists, headers, code blocks should be expressed properly on Discord side as well. Projects that focus on converting messages back and fourth between two platforms already exist but I haven't found similar converter for Python.
Worth noting that Use embeds on Discord side for replies.
is on TODO list for the project, however this PR still uses non embed way of replies. Yet with changes in this PR I think it should be easier to complete that TODO in the future (even though it is not my goal for this PR to accomplish that).
This PR does not introduce any new external dependencies.
Currently PR is in draft mode until I finish working with it completely (most notably, emoji conversion should be done, also, polishing and bug squashing). Wanted to create this PR before I finish to extend the time for discussion over this PR. I'm personally running modified branch with those changes on my own server however additional testing and feedback is appreciated.
This pull request introduces 2 alerts when merging 1512dc5be121df034c7712e23cb8934dd5905b07 into 79308b60625bfc00c495fa731e5154075c86b090 - view on LGTM.com
new alerts:
- 2 for Unused import
Hi, thanks a lot for the PR! I'm a bit occupied with school stuff for a couple of weeks so won't be able to review this until then.
I've been holding off from writing unit tests for this project due to laziness, but such a component definitely needs some. I'll write them for the PR once I review it, and hopefully write some for the other components as well.
I believe I have now finished the most difficult part of writing code, now I'll continue testing this PR on my own instance, however the effects and formatting done is visible on images below. Big thanks go to @Markus-Rost for huge help testing it and giving me feedback on this PR.
(noticed that masked link example isn't visible, that's due to a faulty HTML I've fed to Matrix, not code)
Hi, thanks a lot for the PR! I'm a bit occupied with school stuff for a couple of weeks so won't be able to review this until then.
I've been holding off from writing unit tests for this project due to laziness, but such a component definitely needs some. I'll write them for the PR once I review it, and hopefully write some for the other components as well.
That's fine, please take care of your school stuff first :) I don't yet feel comfortable merging this PR anyways because I barely finished writing the code for it and there are probably still some nasty issues there and there I'd need to take care of. When I feel like it's good enough I'll remove draft state from it. But whoever uses the bridge and wants to test I invite you to help out!
Hey, so I know it took a while for me to get motivation. I consider the majority of the work finished. I think there are still some bugs with links in replies however I cannot find the messages which caused issues in the past so I can't remember how to recreate that issue. I'll undraft this PR because for the entire time I've ran bridge with this PR we didn't have any significant issues and I don't know whether I'll actually have the time to work on it in the future due to private matters. I'll still be happy to apply changes in the near future if something comes up in review/during testing.