Hacksore / discord-md

All the features of Discord flavored markdown
https://discord-md.vercel.app
7 stars 3 forks source link

Multi-line (i.e. fenced) code-block start should not include the code itself #2

Closed serious-angel closed 4 weeks ago

serious-angel commented 3 months ago

Greetings,

I like the current design, and especially the current colors on the main page:

image

❤️


The content of the project, however, is not sufficient nor correct enough with alternatives I believe.

For instance, the following:

https://github.com/Hacksore/discord-md/blob/9f4c5d67047edda35a5dae057b7689a916668e14/apps/web/src/content/feature/code-blocks.md?plain=1#L10-L12

image

This is not a standard Markdown format, including CommonMark, of such code-block also called fenced code blocks (RFC7764).
Some would call such escaping backticks at this point.


In other words, it should not be:

```haikus...```

...but rather:

haikus...

Since, this also allows to set the syntax (e.g. CoffeeScript):

```coffee
haikus...


Best and kind regards
Hacksore commented 3 months ago

Hey @artshade thanks for the issue!

let's use this issue to make a preview component so that we can get rid of the images.

Hacksore commented 3 months ago

so played around with creating an astro component that would let us have markdown previewer.

It's pretty bad atm because I am using marked but maybe it could be the way for now at least?

https://discord-md.vercel.app/feature/misc#testing-md-with-astro-comp

The other option is figure out how to create a custom rehype/remark plugin do have something like this in .md files.

image

and it would output something like this.

image
Hacksore commented 3 months ago

Pushed a few updates but also found that this table on mdxjs.com is almost what trying to build 😂.

The only difference instead of showing HTML on the far right it'd be what it looks like in discord.

image

how they do it for ref https://raw.githubusercontent.com/mdx-js/mdx/main/docs/table-of-components.mdx

Hacksore commented 4 weeks ago

I think this is ok now with the preview component, if you find another bug raise a new issue.

feel free to break stuff on the playground. https://discord-md.vercel.app/play