Add markdown field support through SimpleMDE#2949
Merged
Merged
Conversation
Contributor
Author
|
Hey hey, may I get some thoughts on this? It'd be great if we can get it in the gem, so let me know what I can do to achieve that 😃 |
Contributor
|
Would be really glad to see this feature 👍 |
|
This would be a great addition. Please merge! |
Member
|
Nice work, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was looking for markdown editing support in
rails_adminand came across this stale issue #1235. After some digging I couldn't find a satisfactory solution in built-in support or plugins, so thought I'd take a stab at it myself.I decided to go with SimpleMDE after some research since it looks neat and very simple to use.
With this feature, you can do
field :text_field, :simple_mdeand have a SimpleMDE markdown editor. The easiest way to enable it issimplemde-railswhich unfortunately uses a somewhat outdated SimpleMDE version,but I've opened an issue there to hopefully update itfixed in KHN190/simplemde-rails#1. Users can also just load SimpleMDE themselves.This is how it looks like:
Test coverage:
Linter is complaining that 2 lines in the coffeescripts are too long... but there are longer lines existing in the same file, not sure if I should bother with it.
cc @mshibuya