Comments (10)
0.15.0 has been released with the fix.
from commonmark.net.
Thank you, it indeed reproduces the issue; it seems that the tab conversion is incorrect since using four spaces instead of tabs work as expected.
I will let you know as soon as it is fixed.
from commonmark.net.
Sorry about the very slow response rate...
The 0.15.0 release was again improperly compiled and thus was actually an older version of the binaries. 0.15.1 that I just pushed to nuget should fix it.
from commonmark.net.
I tested it on my implementation and it seems to work for 2 levels nested listings.
So good job, thanks!
from commonmark.net.
What is the Markdown text you're passing to the converter? If I run the following test, I get the correct output:
using System;
//
using NUnit.Framework;
//
using CommonMark;
namespace CommonMarkTests
{
[TestFixture]
public class MarkdownListTests
{
[Test]
public void NestedListsShouldProduceValidHTML_Test()
{
// arrange
string original = string.Join(Environment.NewLine, "- item1" , "- item2", " - item2-1" , " - item2-2", " - item2-3");
string expected = "<ul>{0}<li>item1</li>{0}<li>item2{0}<ul>{0}<li>item2-1</li>{0}<li>item2-2</li>{0}<li>item2-3</li>{0}</ul>{0}</li>{0}</ul>{0}{0}".Replace("{0}", Environment.NewLine);
string actual = string.Empty;
// act
actual = CommonMarkConverter.Convert(original);
// assert
Assert.AreEqual(expected, actual);
}
}
}
This is an NUnit 3 test, with the extra line return mentioned in #105 (which means this will fail when the next release is made).
from commonmark.net.
The list is exactly something I want to convert, its a Unit test in my library.
I do not use .Convert to HTML, I only use the Parsing to c# object with .Parse.
https://github.com/Toine-db/Xamarin.MarkdownParser/blob/master/Sources/Xamarin.MarkdownParser.Core/MarkdownParser.cs#L27
I really get a list in list in list
https://1drv.ms/i/s!AqZ7dJLKaN9Tj-5zE9IqzqbPvFklXw
(an enumeration from item2, skipping item 1)
At this point in code I only read a md file and used it for CommonMarkConverter.Parse()
PS: Im working on 0.14 and using https://github.com/Knagis/CommonMark.NET/blob/master/CommonMark/CommonMarkConverter.cs#L252
from commonmark.net.
Could you please upload the exact file you are parsing and getting this result? Perhaps there are some tab characters hidden there.
I tried it with the console app and it works correctly:
>type test.txt
* item1
* item2
* item2-1
* item2-2
* item2-3
>CommonMark.Console.exe --ast test.txt
document
list(type=bullet tight=True bullet_char=*)
list_item
paragraph
str "item1"
list_item
paragraph
str "item2"
list(type=bullet tight=True bullet_char=*)
list_item
paragraph
str "item2-1"
list_item
paragraph
str "item2-2"
list_item
paragraph
str "item2-3"
from commonmark.net.
Thanks for helping guys.
The file is in my rep; https://github.com/Toine-db/Xamarin.MarkdownParser/blob/master/Sources/Xamarin.MarkdownParser.Test/examples/sections/nestedlist.md
from commonmark.net.
Just checked, and the same issue still occurs on: (with indent by tabs)
- item1
- item2
- item2-1
- item2-2
- item2-3
from commonmark.net.
@Knagis no problem, I also don't have a lot of time...... it's great you have taken a look.
Thanks, ill test it in a few days (hopefully)
from commonmark.net.
Related Issues (20)
- Support for target attribute for links HOT 2
- Extend CommonMark.Net with custom rules HOT 1
- - [ ] Doesn't render a checkbox HOT 1
- Newlines appended to conversions HOT 2
- ASPNET Core 1.1 - You must add a reference to assembly 'mscorlib HOT 3
- CommonMark.CommonMarkConvert.Convert() adds two trailing CR/LFs HOT 1
- How is syntax highlighting expected to work? HOT 3
- Nested list creating extra list when using tab indent not yet fixed HOT 1
- Image source containing spaces are not supported HOT 1
- Some KUDOS to you :) - && a feature request HOT 2
- Question Re AST - Not Issue HOT 1
- Cannot nest bold and italics
- Github style line breaks? HOT 1
- Pipe tables are not created when converting to HTML HOT 5
- Output of CommonMarkConverter.Convert("\\&") is "<p>&amp;</p>" HOT 1
- Benchmark with markdig HOT 1
- Bold, Italic, and monospace don't seem to be working for me. HOT 2
- 1111
- Sorry, noob question: Can I use this for Console.Program? HOT 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 commonmark.net.