NppMarkdownPanel icon indicating copy to clipboard operation
NppMarkdownPanel copied to clipboard

[Feature Request] Discord-Flavored Markdown Toggle for Preview

Open unlishema opened this issue 6 months ago โ€ข 2 comments

First off โ€” I really appreciate this plugin! It makes writing long-form posts for Discord, such as guides or announcements, much easier. However, Discord Markdown (DFM) has a number of key differences from standard Markdown formats (CommonMark, GFM, etc.), which leads to inaccurate previews.

Iโ€™d like to request a Discord-Flavored Markdown toggle to preview text as it would render in Discord.


๐Ÿงฉ Why This Matters

When drafting announcements, guides, or bots that generate formatted messages, it's crucial to see an accurate preview of how Discord will render the Markdown โ€” not just a standard Markdown view.

Some features in standard Markdown donโ€™t work in Discord, and some of Discordโ€™s features donโ€™t exist in normal Markdown.


โœ… Features That Are Needed (Important for Compatibility)

These features directly affect how users format content and will cause confusion or misalignment without proper preview:

๐Ÿ”ธ No Horizontal Rules

Discord does not render these lines:

---
***
___

They just show up as plain text.


๐Ÿ”ธ No Tables

Discord does not support tables like GitHub Markdown:

| Name | Role  |
|------|-------|
| Joe  | Admin |

This shows up as plain text with broken spacing.


๐Ÿ”ธ Blockquotes Behave Differently

Standard Markdown:

> This is a quote
>
> That spans multiple lines.
> Still in the same quote block.

Image

Discord Markdown:

> This is a quote  
> This is a new line  
>   
> This starts a new paragraph

Image

  • Blank lines break the quote
  • Indented/nested blockquotes are not supported
  • No support for wrapped paragraphs inside a quote

๐Ÿ”ธ >>> Multiline Quote โ€” Discord-Only

Discord supports:

>>> This is a multiline quote  
It continues here  
And here  

Everything after >>> is quoted until a new paragraph or block โ€” this doesn't exist in standard Markdown.


๐Ÿ”ธ Spoiler Tags

Discord has its own syntax:

||This is hidden text||

This renders as clickable, hidden text. Not part of any standard Markdown.


๐Ÿ”ธ Underline Support

__This is underlined__

Not supported by standard Markdown โ€” works only in Discord.


๐Ÿ”ธ Code Blocks Are Mostly Compatible (but minor differences exist)

Discord supports:

```js
console.log("Hello World");

Image

  • Language tags are supported (e.g., js, diff, json, etc.)
  • Inline code (\code``) also works as expected

But:

  • No support for specifying titles or captions
  • No support for line numbers or advanced syntax highlighting

๐Ÿ”ธ No Support for Images

This won't render an image in Discord:

![Alt Text](https://example.com/image.png)

Instead, you must paste image URLs directly on a line or upload the file.


๐Ÿ”ธ No Inline HTML

Inline HTML (like <br>, <b>, <u>) is ignored completely:

Here is a line<br>And a new one

Wonโ€™t work in Discord.


๐Ÿ”ธ Links Are Limited

Discord supports basic links:

[Visit Site](https://example.com)

But:

  • No support for optional titles like [Text](url "Tooltip")
  • Previews only work on bare links (not [text](link))

๐Ÿ”ธ No Footnotes or Extended Markdown Features

Discord doesn't support:

Here is a reference[^1]

[^1]: Footnote text here.

No footnotes, definitions, or advanced extensions.


๐Ÿ’ก Features That Would Help (Optional but Useful for Accuracy)

These arenโ€™t critical, but including them in preview would greatly improve realism:

๐Ÿ”น List Formatting Is Sensitive

Standard Markdown allows nested lists:

1. First
   - Sublist

Discord renders this poorly or not at all โ€” no support for nesting or task lists:

- [x] Task 1
- [ ] Task 2

๐Ÿ”น Emoji & Mentions

Discord renders:

  • :smile: โ†’ ๐Ÿ˜„
  • <@123456789> โ†’ user ping
  • <#channelid> โ†’ channel mention
  • <t:timestamp:F> โ†’ formatted timestamp

Would be helpful for preview realism but not essential.


๐Ÿ”น Escaping Markdown in Discord is Trickier

Discord uses \ for escaping, but:

  • Whitespace and line position affect whether the escape works
  • Escaping inside inline code blocks may behave unexpectedly

This differs slightly from standard Markdown engines.


๐Ÿ“Œ Suggested Feature: Discord Markdown Toggle

โœ… Adds value by:

  • Providing an accurate view of Discord formatting
  • Preventing formatting errors before content is posted
  • Supporting developers writing bot outputs, guides, and announcements

Thank you again for this plugin!

This would be a game-changing quality-of-life improvement for those of us who work in Discord daily.

unlishema avatar Jun 17 '25 16:06 unlishema

Hi @unlishema, thanks for the detailed feature request. The plugin uses the library markdig to convert markdown to HTML. Since Discord Markdown contains some significat changes to standard Markdown, I think the best way would be to ask the markdig maintainer to add some kind of "Discord" profile for markdown processing. In that case it would be quite easy for me to integrate that into the plugin. Another possibility could be the integration of an additional markdown converter. But I couldn't find a C# lib which handles Discord Markdown.

mohzy83 avatar Jul 01 '25 10:07 mohzy83

I'm currently at work, but I can take a look for a Markdown library for C# once I get home. I'll also look into the possibility of requesting this feature for Markdig.

Thank you for your interest in my proposal!

unlishema avatar Jul 01 '25 10:07 unlishema