I'm using Redcarpet as markdown tool and coderay for syntax highlighting in my rails app. What I want is a preview of what is being written in markdown format before posting it in database. A far better option is a live preview of what's being written like stackoveflow. I know there are many other options but is there any way to stick with redcarpet and coderay and still having a preview of my post with syntax highlighting? Most of the preview options skip the syntax highlighting portion, they even can't detect codes! At least detecting that portion as a code will do. I just need a preview of my post before publishing it. How can I achieve that? I am not interested in using any WYSIWYG editor either!
Markdown live preview like stackoverflow for redcarpet on rails
1.4k views Asked by Shuvro At
1
There are 1 answers
Related Questions in RUBY-ON-RAILS
- How to display legend box in tooltip text for amCharts 5 in Rails application?
- how to integrate cashfree payment gateway in ruby on rails project
- RSpec Capybara throwing Selenium error when trying to click a button with browser confirm
- rails minitest not picking up fixture properly, instance variable not percolating
- Duplicate GET requests - Rails & Heroku
- How to stub out current_user in JWT model for Rspec?
- NameError in Home#index
- Verifying Google Identity OAuth2 token with Ruby
- Error WebMock::NetConnectNotAllowedError in testing with stub using minitest in rails (using Faraday)
- why is mission_control-jobs erroring with load path error?
- Rescuing validation errors from a polymorphic association
- New error on random number assigned to local variable , Rails
- How to fix error in model with gem lockbox
- Images uploaded via Active Storage not displaying in Active Admin or on certain devices
- controller test_methods generating two errors intermittently
Related Questions in MARKDOWN
- JavaScript For, functions and mixed return
- Creating a Shields.io Badge that Links to Email Address
- Rehype to render hashtag as url
- Markdown rendering error when typing: ``Hello
- ParseError: KaTeX parse error: No such environment: tikzpicture
- Highlight markdown text in android
- How to underline a header in jupyter notebooks
- R - pander not passing use.hyphening = TRUE parameter
- Python: Convert Markdown to html with Codeblocks like in stackoverflow
- How to output latex embedded in dataframe into jupyterbook
- Moving author title and date to one column of a two-column page with markdown and pandoc for a PDF output
- Markdown lines count in Streamlit or in Python
- Issues with Katex/ngx-markdown Rendering in Angular 16
- Neovim: no syntax highlighting with treesitter for markdown
- Markdown react render
Related Questions in REDCARPET
- Wrong Markdown rendering with Redcarpet and Rails 7
- Using ERB in Markdown with Redcarpet in Rails 7.1
- Rouge and redcarpet don't hightlight ruby code
- Assign metadata to blockquotes in markdown
- redcarpet gem renderer that makes links out of `[[` blocks
- How can I use fenced_code_blocks in redcarpet to render the output in block?
- How can I turn off certain tags for redcarpet in RoR?
- Jekyll Rouge washed out Monokai color
- Ruby, How to prevent Redcarpet to render HTML code in the output?
- parse_markdown and truncate
- ruby on rails redcarpet code block not respecting indentation
- Can anyone explain me how does :hard_wrap work?
- Prevent Redcarpet from parsing a specific markdown feature
- How to remove the end slash from the img tag?
- Using ERB in Markdown with Redcarpet
Related Questions in CODERAY
- How to add line breaks to Redmine markdown in code highlighting?
- How can I use RedCarpet without CodeRay to implement markdown in my blogs?
- CodeRay adds incorrect indentation
- Getting the list of available languages
- CodeRay style messed up - how to fix
- How to mark search phrase in syntax highlighted markdown code?
- syntax highlighting with coderay, asciidoctor not working
- Show syntax name for code snippets
- Coderay renders actual ruby code
- using Coderay with a html.erb file
- Make Coderay (in Pry) highlight comments
- Markdown live preview like stackoverflow for redcarpet on rails
- RVM Errno::EACCESS pry pry-doc
- CodeRay throws error in Rails console
- Is it possible to use CodeRay in github pages?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Your options are either to stick with Redcarpet and use Ajax or to switch to a javascript based markdown processor like: https://github.com/evilstreak/markdown-js and a javascript based syntax highlighter such as: https://github.com/google/code-prettify
With your current setup you'd have to send the markdown to the server via Ajax, process it with Redcarpet then send it back to the browser and inject it into a preview area. This will be much slower and more taxing on your server when traffic goes up. I wouldn't recommend it.
Switch to the js based markdown processor and syntax highlighter so you can do it all in the browser.