Coder Social home page Coder Social logo

p6-markdown's People

Contributors

altai-man avatar coke avatar emeric54 avatar jj avatar marmay avatar matiaslina avatar moritz avatar retupmoca avatar szabgab avatar uzluisf avatar zoffixznet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

p6-markdown's Issues

Possible issue with rendering styling on links

I'm unfamiliar with what plain Markdown is meant to handle, but applying styling to links (e.g. bold or code styles) works on GitHub, yet ends up verbatim, unrendered with Text::Markdown:

foo bar ber meow

$ perl6 -MText::Markdown -e 'Text::Markdown.new("[`foo` *bar* **ber** ***meow***](blarg)").render.say'
<p><a href="blarg">`foo` *bar* **ber** ***meow***</a></p>

$ perl6 -v
This is Rakudo version 2017.10-3-gf40babb built on MoarVM version 2017.10
implementing Perl 6.c.

Inline links break inline HTML code

Given the following piece of Markdown

<h1>Hello</h1>

the HTML output should be literally the same, but at the moment, the HTML tags are converted to inline links, i.e. the HTML output is the following:

<a href="h1">h1</a>Hello<a href="/h1">/h1</a>

As far as I am aware of, inline links are supposed to be used if and only if

  • the enclosed text is an URL or
  • the enclosded text is an email address.

I hope that I'll be able to provide a patch for this issue.

Inline code within headers and links

Inline code (``) within headers (#, ##, etc.) and links ([]()) doesn't seem to be rendered:

use Text::Markdown;

say Text::Markdown.new('# The `sub` keyword').render;
# Output:   <h1>The `sub` keyword</h1>
# Expected: <h1>The <code>sub</code> keyword</h1>


say Text::Markdown.new('The [`sub`](#) keyword').render;
# Output:   <p>The <a href="#">`sub`</a> keyword</p>
# Expected: <p>The <a href="#"><code>sub</code></a> keyword</p>

unordered list

I seam to be having problems with producing an list: currently I have tied the following:

* Item 1
* Item 2

The code Im using:

use Text::Markdown;
multi sub MAIN ( $mdFile ) {
  my $md = parse-markdown-from-file($mdFile);
  say $md.render;
}

Which doesn't convert into html. Is there something I'm missing?
Thank you for your prompt reply.
-Michael

Nested lists not yet supported

If I do:

* Foo
    * Bar
    * Baz

Then it doesn't render them as nested bullet points, but instead as a bunch of * on the same line as the first bullet point.

RFE - bin/markdown2html

Is there any interest in shipping a wrapper script that would generate HTML given a markdown file? If so, I can see about putting a PR together.

Problems parsing URLs with underscores

For instance, try this

use v6;
use Text::Markdown::Document;
use Test;

plan 3;

my $text = q:to/TEXT/;
this character belongs to this
[category](https://en.wikipedia.org/wiki/Unicode_character_property#General_Category),
TEXT

my $document = Text::Markdown::Document.new($text);
ok $document ~~ Text::Markdown::Document, 'Able to parse';
is $document.items.elems, 2, 'has correct number of items';

my $p = $document.items[0];
ok $p ~~ Text::Markdown::Paragraph, 'It is a Paragraph';

dd $p.items;

It returns

1..3
ok 1 - Able to parse
ok 2 - has correct number of items
ok 3 - It is a Paragraph
Array @!items = ["this character belongs to this [category](https://en.wikipedia.org/wiki/Unicode", Text::Markdown::Emphasis.new(text => "character", level => 1), "property#General_Category),"]

It's splitting at the _ level, instead of extracting the link correctly.

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.