Can posts have a body and a URL?

Is markdown supported?

Console.WriteLine("Hello, World")

Do code blocks work?

What about with syntax highlighting?

console.log("Hello, World");

Can I make a code block with indentations?

var a = “Hello” var b = “World” console.log(${a}, ${b});

Let’s see what quotations look like,

This is a quote.

And this one will be multiline.

Line one. Line two.

There should be a space above.

I think that’s enough testing for now.

  • michaelcharlesOP
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 years ago

    So, markdown supported.

    Can’t make a codeblock by indenting.

    Specifying languages for code blocks doesn’t cause any problems, but there’s no indication of the specified language in the output. No syntax highlighting either.

    Quotes and multiline quotes work.

    Hmmm… images?

    The above should be an image if typical markdown image syntax works.

    • snoweMA
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 years ago

      I wonder how hard it would be to add syntax highlighting. It’s all open source Rust. I can check later to see if there’s anything already set up and it’s just not being rendered.

  • Tonka Truck
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 years ago

    Examples for markdown from lemmy’s documenation

    Example of multiline codeblock:
    func main() {
        fmt.Println("four spaces")
    	fmt.Println("An actual tab indent") // the correct option
    }
    

    I did put ```golang at the beginning of the code block, but at least on my browser, doesn’t seem to highlight it like a markdown file. Though, I don’t see golang in the multiline codeblock either. So the input does get eaten somewhere.

  • Jason Novinger
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 years ago

    I’m curious about Markdown in post titles. Anybody know about that?

    • Jason Novinger
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Looks like at least inline code styling is working in titles: https://programming.dev/post/184949. I also confirmed elsewhere that emojis work in titles.

      I went looking at the Lemmy docs, but didn’t find anything specific about titles. Just this:

      The main type of content in Lemmy is text which can be formatted with Markdown. Refer to the table below for supported formatting rules.