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 Discord markdown #36

Open
LogicalJoe opened this issue Jun 28, 2021 · 3 comments
Open

Support Discord markdown #36

LogicalJoe opened this issue Jun 28, 2021 · 3 comments

Comments

@LogicalJoe
Copy link
Contributor

Someone suggested I do this so here it is.
Shouldn't be hard to add but idk what to put here.
~~ ___ __ _ *** ** * || also `

@Legend-of-iPhoenix
Copy link
Owner

Where exactly do you want discord markdown supported- in posts with some kind of translator (probably building off of https://legend-of-iphoenix.github.io/markdown-bbcode-html/) or in SAX?

@LogicalJoe
Copy link
Contributor Author

LogicalJoe commented Aug 19, 2021

I was thinking in SAX since that sees it get used more often. It already seems to handle *text*-only messages in a somewhat broken way (intentionally for /me which uses _text_?)… but that's fine.
h

@Legend-of-iPhoenix
Copy link
Owner

I was thinking in SAX since that sees it get used more often. It already seems to handle *text*-only messages in a somewhat broken way (intentionally for /me which uses _text_?)… but that's fine.
h

This is a reasonable but incorrect understanding of what is happening. Unlike the Discord <=> IRC bridge, which does not understand /me and uses _text_, the Discord <=> XMPP bridge does emit /me commands. This is pretty weird but we'll roll with it.

You can see this by turning the userstyle off, you'll get something like

***[*] [D] [iPhoenix] sent a message with /me on discord

Now, the sax rewrite special-cases the /me command to make it italic (sax-action class) and a separate tweak removes the [*] from messages because it's usually at least, like, triply redundant.

The net result here is that the message content (for your example, [D] [LogicalJoe] h) is italicized but the thing saying that it's an action (***[*]) is hidden.

Ideally sax.js would treat messages differently if they come through the bridge so this wouldn't happen (I agree with you that it is somewhat broken-looking) but if the bridge changes at all in the future I don't want it to make SAX look bugged-out.

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

No branches or pull requests

2 participants