Comments (9)
Seems you want to reopen this issue for the correct project, this is Earmark not Rails.
from earmark.
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.
Please give us something to work with. Which markdown input breaks what and how?
I cannot reopen the issue without that information.
from earmark.
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.
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.
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.
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.
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.
closed with 55828d1
from earmark.
Related Issues (20)
- All legal options do not seem to be recognized by the Earmark CLI right now HOT 1
- v1.4.41 regression: module :string_lexer is not available HOT 18
- ast back to markdown HOT 9
- Duplicated modules using earmark and earmark_parser HOT 5
- I'd like to maintain earmark HOT 6
- Announcement for change of maintainer HOT 2
- Can't find Earmark.Parser.HtmlRenderer
- Typespecs edits
- Pure link feature does not support inline links without a protocol HOT 3
- Warning on Elixir 1.16 HOT 2
- Applying bold, italics and strikethrough simultaneously is handled inconsistently
- Which flavour/spec of markdown is used by earmark?
- Single ~ is not accepted for strikethrough HOT 2
- Parser situation is confusing HOT 11
- [1.4.46] Parser crash on `Earmark.as_ast("\\[{:}")` HOT 5
- The CLI outputs the input device's name to standard output
- Earmark and EarmarkParser need better documentation about the split. HOT 2
- Earmark crashes (like EarmarkParser) on `"\\[{:}" `
- Proposition: Backport of optional math syntax from EarmarkParser
- Inaccurate spec of Earmark.Parser.as_ast/2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from earmark.