Skip to main content

How is the Trix editor on gorails.com "Parsed with Markdown"?

General • Asked by chrickso

Gravatar
I was considering implementing on my website the ability for users to switch between a markdown editor or the trix editor but then I noticed on this gorails.com editor (which appears to be Trix) it says "parsed with markdown" below it and I'm wondering how this is possible and what I can do to enable my trix editor to parse markdown. It was my understanding that Trix translates what is typed clientside into HTML and the HTML-ized body is content is what is submitted via the form to the rails controller.

Is there some markdown parser customized into the Trix library or is the parser even running clientside or is the parser just run serverside of the HTML-ized body content before it is saved? I would really love any info on how this is done and how I can incorporate the same functionality.

Thanks in advance for any insight.

Gravatar
~~~is this really parsed with markdown test~~~

1. Item 1
1. Item 2
1. Item 3
   1. Item 3a
   1. Item 3b
      1. Item 3b
         1. Item 3b


- [x] @mentions, #refs, [links](), **formatting**, and <del>tags</del> supported
- [x] list syntax required (any unordered or ordered list supported)
- [x] this is a complete item
- [ ] this is an incomplete ite

First Header | Second Header ------------ | ------------- Content from cell 1 | Content from cell 2 Content in the first column | Content in the second column

> guess not

Gravatar
That's actually leftover from when I moved away from SimpleMDE. I forgot to remove that. Unfortunately Trix isn't great for code samples so I think I'm going to be migrating back.

Luckily HTML is valid Markdown, but like you see above, you can't really have Markdown in HTML because the characters will be escaped.

Gravatar

switching back to SimpleMDE or something else? SimpleMDE looks cool but not being updated at all since mid 2016 is worrisome


Gravatar

I'm not sure it's so worriesome. A markdown editor is super simple so unless there are a ton of bugs, there's not much maintenance that you would need.


Gravatar

thanks for the info


Login or create an account to join the conversation.