Code Monkey home page Code Monkey logo

Comments (9)

RobertDober avatar RobertDober commented on August 17, 2024

Seems you want to reopen this issue for the correct project, this is Earmark not Rails.

from earmark.

Ch4s3 avatar Ch4s3 commented on August 17, 2024

No, I use Earmark for a blog backed by Elixir. I just noticed this while moving over an article from my old blog that just happens to be about JRuby and Rails. I did intend to post here.

Here's the page view:

defmodule CodeBlog.PageView do
  use CodeBlog.Web, :view
  alias Earmark.Options

  def markdown(body) do
    body
    |> Earmark.to_html(%Options{gfm: true})
    |> raw
  end
end

and relevant partial:

<%= for post <- @posts do %>
  <div class="post-title">
    <h2><%= post.title %></h2>
  </div>
  <div class="post-body">
    <%= markdown(post.body) %>
  </div>
<% end %>

from earmark.

RobertDober avatar RobertDober commented on August 17, 2024

Please give us something to work with. Which markdown input breaks what and how?
I cannot reopen the issue without that information.

from earmark.

Ch4s3 avatar Ch4s3 commented on August 17, 2024

Oh sorry, I didn't notice that it didn't escape.

   + ```_4.1.9_``` specifies the version of Rails in case you have multiple versions installed.
   + ```--database=postgresql``` sets the database as Postgres
   + There is no need to run ```Jruby -S``` before ```rails new``` since you're using RVM.

This should be exactly what I used. I think the problem is with the +'s for the list. Here's a link to a raw gist of the whole doc.

from earmark.

RobertDober avatar RobertDober commented on August 17, 2024

No problem I might have guessed. I was not very inspired.
In the meantime, in case you have control over the input you could replace the triple backticks with single ones, but I guess you can't.
I'll have a look as soon as possible.

from earmark.

Ch4s3 avatar Ch4s3 commented on August 17, 2024

I can definitely do that in the meantime. I'll see if I can figure out the issue, but I'm still pretty new to elixir, no promises.

from earmark.

RobertDober avatar RobertDober commented on August 17, 2024

Dave's code is worth studying by all means. I am about to fix this with #48 (as I will probably treat pairs of backtix*3 that are not fences and pairs of backtix equally) so it is a little bit unlikely that I will accept a PR for this one. But that said I do not want you to discourage to make one, I just warn you not to be dissapointed as I am working on this now.

Anyway the issue report is appreciated, even if I did not get it immediately ;).

from earmark.

Ch4s3 avatar Ch4s3 commented on August 17, 2024

Cool. I'll poke around the code over the holiday and maybe look for other opportunities. Yeah, Dave's work is pretty amazing.

from earmark.

RobertDober avatar RobertDober commented on August 17, 2024

closed with 55828d1

from earmark.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.