Comments (10)
I threw together a quick test for the expected behavior. https://gist.github.com/Gazler/d7221ad76b20b4f72154
I copied the source style from https://github.com/elixir-lang/elixir/blob/a0be9fe272922fe151e5e42e4ebc464c19fb5c50/lib/elixir/lib/kernel/typespec.ex#L130
from earmark.
@Gazler You missed the back-ticks. It should work without escapes inside back-ticks.
from earmark.
Are there precedents for that behavior?
On Aug 16, 2014 8:57 AM, "Eric Meadows-Jönsson" [email protected]
wrote:
@Gazler https://github.com/Gazler You missed the back-ticks. It should
work without escapes inside back-ticks.—
Reply to this email directly or view it on GitHub
#5 (comment).
from earmark.
That |
shouldn't be a table separator inside back-ticks is obvious to me. How would it even render correctly otherwise? <td><code>foo</td><td>bar</code></td>
is invalid HTML.
For the other issue, are you saying that there should be no way to have |
chars inside tables?
from earmark.
No, of course you should be able to do it.
But I already fixed this in https://github.com/pragdave/earmark/issues/2—it works when you put a backslash in front of the |
Here's the output from typespecs:
I got this by extracting the table into t.md, and then running
./earmark t.md >t.html
Are you perhaps running an older version?
from earmark.
That would explain it, sorry about that Dave. ex_doc is on earmark 0.1.4, I will update it.
Any chance we could also have |
not treated as table separator when it appears between back-ticks.
Current behaviour:
iex(11)> Earmark.to_html("foo | bar\nfoo | `bar | baz`")
"<p>foo | bar\nfoo | <code class=\"inline\">bar | baz</code></p>\n"
Proposed behaviour:
iex(1)> Earmark.to_html("foo | bar\nfoo | `bar | baz`")
"<table>\n<colgroup>\n<col align=\"left\">\n<col align=\"left\">\n</colgroup>\n<tr>\n<td>foo</td><td>bar</td>\n</tr>\n<tr>\n<td>foo</td><td><code class=\"inline\">bar | baz</code></td>\n</tr>\n</table>\n"
from earmark.
I'm resisting this simply because I want to be compatible with the majority
of Markdown processors out there, and right now I haven't surveyed them to
see what they do.
I'm leaving this open until I have time to see what the others do.
On Sat, Aug 16, 2014 at 12:58 PM, Eric Meadows-Jönsson <
[email protected]> wrote:
That would explain it, sorry about that Dave. ex_doc is on earmark 0.1.4,
I will update it.Any chance we could also have | not treated as table separator between
back-ticks.Current behaviour:
iex(11)> Earmark.to_html("foo | bar\nfoo |
bar | baz
")"foo | bar\nfoo | <code class="inline">bar | baz
\n"Proposed behaviour:
iex(1)> Earmark.to_html("foo | bar\nfoo |
\n\n<col align="left">\n<col align="left">\n\n\n\n\n\n\n\nbar | baz
")"\n"
foo bar foo <code class="inline">bar | baz —
Reply to this email directly or view it on GitHub
#5 (comment).
from earmark.
@pragdave The nightly doc builds now use 0.1.10 but we are still seeing the issue with escaped \|
, see http://elixir-lang.org/docs/master/elixir/Kernel.Typespec.html. What should we fix in this code https://github.com/elixir-lang/elixir/blob/master/lib/elixir/lib/kernel/typespec.ex#L125-L146 to make it render correctly?
from earmark.
I don't think you're running the Earmark you think you are.
Here's what I see for that table, running 0.1.11. (to create this, just mix
escript.build in earmark, and earmark typespec.ex)
Built-in typeDefined asterm anybinary<< _ :: _ * 8 >>bitstring<< _ :: _ * 1
booleanfalse | truebyte0..255char 0..0x10ffffnumberinteger | float
char_list[char] list[any]maybe_improper_listmaybe_improper_list(any, any)
nonempty_list nonempty_list(any)iodataiolist | binaryiolist
maybe_improper_list(byte | binary | iolist, binary | []) moduleatom | tuple
mfa{atom, atom, arity}arity 0..255nodeatomtimeout:infinity | non_neg_integer
no_returnnonefun(... -> any)
On Thu, Sep 4, 2014 at 11:28 AM, Eric Meadows-Jönsson <
[email protected]> wrote:
@pragdave https://github.com/pragdave The nightly doc builds now use
0.1.10 but we are still seeing the issue with escaped |, see
http://elixir-lang.org/docs/master/elixir/Kernel.Typespec.html. What
should we fix in this code
https://github.com/elixir-lang/elixir/blob/master/lib/elixir/lib/kernel/typespec.ex#L125-L146
to make it render correctly?—
Reply to this email directly or view it on GitHub
#5 (comment).
from earmark.
You are right, sorry about that again. ex_doc was using defaults I did not expect, the generated docs on elixir-lang.org should use earmark from here on.
from earmark.
Related Issues (20)
- from_file! ignores the options if not a .eex file is passed HOT 2
- 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
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.