haxefoundation / haxe-markdown Goto Github PK
View Code? Open in Web Editor NEWA Markdown parser in Haxe.
License: MIT License
A Markdown parser in Haxe.
License: MIT License
At example for this page : https://lib.haxe.org/p/uuid/ the bullet list after Advantages of FlakeID over UUID :
and after Each Flake ID is 64 bits ...
is not displayed correctly .
Same for table after Uuid.fromShort
.
Correct looking view is here: https://github.com/flashultra/uuid/blob/master/README.md
I've run into some unexpected behavior while parsing markdown documents with inline HTML.
Take this markdown for example:
<div>
# Test
test test test
</div>
When parsed, this is what I would expect:
<div>
<h1>Test</h1>
<p>test test test</p>
</div>
But that is not what results. This is the output from running the markdown through Markdown.markdownToHTML
:
<div>
<h1>Test</h1>
<p>test test test</p>
<p></div></p>
As you can see, there are p tags surrounding the closing div. Now, this will render just fine in browsers, but it is not correct HTML. If there are no problems with it, I would suggest making the parse match the expected result I show. I might be able to help, but I would need some guidance on what to change.
Support code blocks fenced with triple tildes (same as triple backticks, but more symmetrical looking).
Triple tildes are standard commonmark, and are supported by pandoc, github markdown, and other implementations.
The InlineParser.unescape
method seems to be called multiple times on the same text, resulting in some escaping issues. In particular, to output two backslashes in a row, you need to type \\\\\\\\
.
/**
* Test Strikethrough
* ~~Mistaken text.~~
*/
Mistaken text. is expected but no strikethrough in HTML output.
See HaxeFoundation/HaxeManual#69
The relevant markdown looks like this:
Haxelib is the library manager that comes with any Haxe distribution. Connected to a central repository, it allows submitting and retrieving libraries and has multiple features beyond that. Available libraries can be found at [http://lib.haxe.org](http://lib.haxe.org).
Any idea why this would fail?
/**
* Test Auto Linking
* http://example.com
**/
http://example.com is expected, but HTML output does not have link.
Related issue: HaxeFoundation/haxelib#254
Markdown.markdownToHtml("`||`");
results in:
<table><thead><th align="undefined">`</th><th align="undefined">`</th></thead><tbody></tbody></table>
Hey David,
hope you're doing well. Would you mind transferring this repository over to the HaxeFoundation org on GitHub so we can continue to maintain it?
We would also like to add the HaxeFoundation haxelib account to the list of contributors for both this repository and dox. Since it's probably a bit of a hassle for you to set that up, we can handle this ourselves but would like to ask for your permission because we don't like hacking haxelib content without the author's consent.
Thanks!
Hello!
I was trying out a few things with the markdown parser, and noticed that it doesn't seem to handle nested lists. I don't think nested lists are actually in the markdown "spec," but it seems that implementations often support them. Thanks for your work on this project!
var myMarkdown = `
- item 1
- item 2
- item 3
- item 4
- item 5
`;
Results in this markup:
<ul>
<li>item 1</li>
<li>item 2
- item 3
- item 4
</li>
<li>item 5</li>
<li>item 6</li>
</ul>
```haxe
var x = 12;
trace('The sum of $x and 3 is ${x + 3}'); // The sum of 12 and 3 is 15
```
String interpolation is ....
This example was from the Haxe manual.
I'm happy to take a look at this at some point not this week if you remind me :)
Compare the anchor links between these two pages:
http://haxe.org/manual/cr-resources.html
https://github.com/HaxeFoundation/HaxeManual/blob/master/md/manual/cr-resources.md
The github version links to this:
cr-resources.md#841-embedding-resources
On haxe.org we have this instead:
cr-resources.html#8.4.1-embedding-resources
So it looks like the dots are removed in github's markdown interpretation.
I don't know which one should be considered "correct". Or is this not related to haxe-markdown at all?
Hi David,
how hard would it be to support GitHub-style tables?
Something | like |
---|---|
this | ! |
We are using your markdown parser for the new Haxe website and want to support tables. If this cannot be supported easily I'll check if I can generate HTML directly.
The following Markdown
1. a
* a.a
* a.b
2. b
3. c
Should generate nested lists, as Github do:
However, haxe-markdown generates:
<ol><li>
<p>a
* a.a
* a.b</p></li><li>b</li><li>c</li></ol>
That's quite ugly, considering that I have used nested lists for haxe.org content: http://haxe.org/documentation/introduction/building-haxe.html (see Building on Windows (Cygwin)
first item).
This renders as a table while it shouldn't: a | b | c
(see HaxeFoundation/haxelib#320)
Moved from HaxeFoundation/dox#124
I believe this markup should show a bullet:
/**
* Some comment
* - Some bullet
*/
But instead it renders like this: Some comment - Some bullet
.
Adding a blank line in between the comment and the bullet list restores the bullet.
GitHub markup dramatization:
Some comment
Originally reported at HaxeFoundation/haxelib#226
# Hello <!-- comment -->
produces
<h1>Hello <!-- comment --></h1>
This should be an easy fix. We just need to insert a new text syntax after this line:
https://github.com/dpeek/haxe-markdown/blob/master/src/markdown/InlineParser.hx#L46
From the Haxe documentaion:
NEGATIVE_INFINITY or POSITIVE_INFINITY
Is being converted to:
NEGATIVE<em>INFINITY or POSITIVE</em>INFINITY
Pattern needs to ignore underscore unless preceded by whitespace?
Hey David,
there have been quite a few commits to dart-markdown and I was wondering if there is anything we should port back to haxe-markdown. I was looking through the commits but it's hard for me to tell what is specific to dart or the library structure and what are actual improvements to markdown parsing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.