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

Proposal: Support Discord Markdown #23

Open
1 task done
l-zeuch opened this issue Feb 10, 2022 · 4 comments
Open
1 task done

Proposal: Support Discord Markdown #23

l-zeuch opened this issue Feb 10, 2022 · 4 comments
Labels
area/syntax affecting syntax highlight editor/vim-neovim affecting both Neovim and Vim type/enhancement New feature or request
Milestone

Comments

@l-zeuch
Copy link
Owner

l-zeuch commented Feb 10, 2022

Description

When writing output of custom commands, it is quite a regular thing to use Discord's markdown to spice it up a little and make it more appealing.

Solution

For this, I suggest to detect and highlight Discord's markdown markers, just like some markdown extensions already do. I understand that some formatting might get a little weird, for this we'd have to think of a way and maybe look laterally, how other extensions specifically for markdown handle that.

Furthermore it might be worthwhile to highlight markdown only when it makes sense, i.e. in print*, cembed field values and descriptions, and of course in plain text.

Code of Conduct

  • I agree to follow this project's Code of Conduct.
@LRitzdorf
Copy link
Collaborator

LRitzdorf commented Feb 10, 2022

Great idea! This would be nice, but I'm thinking it might throw a monkey wrench into some of our existing highlighting, if not done properly. I can take a look at that.

Also, in terms of appropriate areas to perform this highlighting, we should be able to restrict it to normal text and within the String group without too much trouble.

@l-zeuch
Copy link
Owner Author

l-zeuch commented Feb 10, 2022

Also, in terms of appropriate areas to perform this highlighting, we should be able to restrict it to normal text and within the String group without too much trouble.

Yes but also kinda no -- note that some functions take string arguments, but don't actually print said argument to chat, for example dbGet's key argument, which is linked to the string hl-group.

This should be considered and was the point I tried to chase in my initial comment, to only highlight markdown where it actually makes sense.

I presume that was what you meant with it might throw a monkey wrench into our existing highlighting?

@LRitzdorf
Copy link
Collaborator

Mm, sort of. I was primarily thinking about all the contained matches we have, and how adding syntax regions in other places might allow for incorrect highlighting within them. For example, if we have a Markdown codeblock region, CC syntax elements like cslice might highlight inside that if we aren't careful.

I know I did a bit of a syntax rewrite earlier, but it still feels a bit messy, so I might try to reevaluate things and add Markdown formatting as part of that.

@l-zeuch
Copy link
Owner Author

l-zeuch commented Feb 10, 2022

For example, if we have a Markdown codeblock region, CC syntax elements like cslice might highlight inside that if we aren't careful.

Ah, that does make a little more sense. Totally missed that in the first place 😅

I know I did a bit of a syntax rewrite earlier, but it still feels a bit messy, so I might try to reevaluate things and add Markdown formatting as part of that.

Sure, that sounds good -- A cleaner code focussed on extensibility is always preferable.

@l-zeuch l-zeuch added type/enhancement New feature or request area/syntax affecting syntax highlight editor/vim-neovim affecting both Neovim and Vim labels Mar 29, 2022
@l-zeuch l-zeuch self-assigned this Apr 12, 2022
@l-zeuch l-zeuch added this to the Backlog milestone May 29, 2022
@l-zeuch l-zeuch removed their assignment Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/syntax affecting syntax highlight editor/vim-neovim affecting both Neovim and Vim type/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants