Compare commits

...

11 Commits

Author SHA1 Message Date
Alexandre Mutel
5020fdd3b1 Bump to 0.14.8 2017-12-05 09:36:48 +01:00
Alexandre Mutel
bd4ea56d2a Fix potential StackOverflow exception when processing deep nested | delimiters (#179) 2017-12-05 09:34:59 +01:00
Alexandre Mutel
fbc8a4116c Bump to 0.14.7 2017-11-25 14:17:23 +01:00
Alexandre Mutel
9af318d334 Merge pull request #175 from terryjintry/fixautolink
fix autolink attribute
2017-11-24 09:29:44 +01:00
Terry Jin
88e561c3ae fix autolink attribute 2017-11-24 14:34:44 +08:00
Alexandre Mutel
1ca82eb058 Bump to 0.14.6 2017-11-21 07:36:14 +01:00
Alexandre Mutel
66007c6bbf Add TestLink example (#171) 2017-11-21 07:35:17 +01:00
Alexandre Mutel
14d4286fd7 Merge pull request #170 from yishengjin1413/master
fix yaml frontmatter issue when ending with a empty line
2017-11-20 08:26:47 +01:00
Terry Jin
58b1a48f5b fix yaml frontmatter issue when ending with a empty line 2017-11-20 15:11:16 +08:00
Alexandre Mutel
5e1eaf8590 Bump to 0.14.5 2017-11-18 17:08:21 +01:00
Alexandre Mutel
c946295d96 Fix link to changelog.md in Markdig.csproj 2017-11-18 17:08:11 +01:00
9 changed files with 43 additions and 28 deletions

View File

@@ -1,5 +1,13 @@
# Changelog
## 0.14.8 (05 Dec 2017)
- Fix potential StackOverflow exception when processing deep nested `|` delimiters (#179)
## 0.14.7 (25 Nov 2017)
- Fix autolink attached attributes not being displayed properly (#175)
## 0.14.6 (21 Nov 2017)
- Fix yaml frontmatter issue when ending with a empty line (#170)
## 0.14.5 (18 Nov 2017)
- Fix changelog link from nuget package
## 0.14.4 (18 Nov 2017)
- Add changelog.md
- Fix bug when a thematic break is inside a fenced code block inside a pending list (#164)

View File

@@ -20630,6 +20630,7 @@ namespace Markdig.Tests
// The following CommonMark:
// ---
// this: is a frontmatter
//
// ...
// This is a text
//
@@ -20637,7 +20638,7 @@ namespace Markdig.Tests
// <p>This is a text</p>
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 4, "Extensions YAML frontmatter discard");
TestParser.TestSpec("---\nthis: is a frontmatter\n...\nThis is a text", "<p>This is a text</p>", "yaml");
TestParser.TestSpec("---\nthis: is a frontmatter\n\n...\nThis is a text", "<p>This is a text</p>", "yaml");
}
}
// If the end front matter marker (`...` or `---`) is not present, it will render the `---` has a `<hr>`:

View File

@@ -47,6 +47,7 @@ It can end with three dots `...`:
```````````````````````````````` example
---
this: is a frontmatter
...
This is a text
.

View File

@@ -1,4 +1,4 @@
// Copyright (c) Alexandre Mutel. All rights reserved.
// Copyright (c) Alexandre Mutel. All rights reserved.
// This file is licensed under the BSD-Clause 2 license.
// See the license.txt file in the project root for more information.
using System;
@@ -12,6 +12,14 @@ namespace Markdig.Tests
[TestFixture]
public class TestPlayParser
{
[Test]
public void TestLink()
{
var doc = Markdown.Parse("There is a ![link](/yoyo)");
var link = doc.Descendants<ParagraphBlock>().SelectMany(x => x.Inline.Descendants<LinkInline>()).FirstOrDefault(l => l.IsImage);
Assert.AreEqual("/yoyo", link?.Url);
}
[Test]
public void TestListBug2()
{

View File

@@ -82,10 +82,10 @@ namespace Markdig.Extensions.Yaml
{
c = fullLine.NextChar();
}
nc = fullLine.NextChar(); // skip \n
nc = fullLine.PeekChar();
if (nc == '-')
{
if (fullLine.NextChar() == '-' && fullLine.NextChar() == '-' && (fullLine.NextChar() == '\0' || fullLine.SkipSpacesToEndOfLineOrEndOfDocument()))
if (fullLine.NextChar() == '-' && fullLine.NextChar() == '-' && fullLine.NextChar() == '-' && (fullLine.NextChar() == '\0' || fullLine.SkipSpacesToEndOfLineOrEndOfDocument()))
{
hasFullYamlFrontMatter = true;
break;
@@ -93,7 +93,7 @@ namespace Markdig.Extensions.Yaml
}
else if (nc == '.')
{
if (fullLine.NextChar() == '.' && fullLine.NextChar() == '.' && (fullLine.NextChar() == '\0' || fullLine.SkipSpacesToEndOfLineOrEndOfDocument()))
if (fullLine.NextChar() == '.' && fullLine.NextChar() == '.' && fullLine.NextChar() == '.' && (fullLine.NextChar() == '\0' || fullLine.SkipSpacesToEndOfLineOrEndOfDocument()))
{
hasFullYamlFrontMatter = true;
break;

View File

@@ -5,14 +5,14 @@
<Copyright>Alexandre Mutel</Copyright>
<AssemblyTitle>Markdig</AssemblyTitle>
<NeutralLanguage>en-US</NeutralLanguage>
<VersionPrefix>0.14.4</VersionPrefix>
<VersionPrefix>0.14.8</VersionPrefix>
<Authors>Alexandre Mutel</Authors>
<TargetFrameworks>net35;net40;portable40-net40+sl5+win8+wp8+wpa81;netstandard1.1;uap10.0</TargetFrameworks>
<AssemblyName>Markdig</AssemblyName>
<PackageId>Markdig</PackageId>
<PackageId Condition="'$(SignAssembly)' == 'true'">Markdig.Signed</PackageId>
<PackageTags>Markdown CommonMark md html md2html</PackageTags>
<PackageReleaseNotes>https://github.com/lunet-io/markdig/blob/master/changelod.md</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/lunet-io/markdig/blob/master/changelog.md</PackageReleaseNotes>
<PackageIconUrl>https://raw.githubusercontent.com/lunet-io/markdig/master/img/markdig.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/lunet-io/markdig</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/lunet-io/markdig/blob/master/license.txt</PackageLicenseUrl>

View File

@@ -26,6 +26,7 @@ namespace Markdig.Renderers.Html.Inlines
renderer.Write("mailto:");
}
renderer.WriteEscapeUrl(obj.Url);
renderer.Write('"');
renderer.WriteAttributes(obj);
if (!obj.IsEmail && AutoRelNoFollow)
@@ -33,7 +34,7 @@ namespace Markdig.Renderers.Html.Inlines
renderer.Write(" rel=\"nofollow\"");
}
renderer.Write("\">");
renderer.Write(">");
}
renderer.WriteEscape(obj.Url);

View File

@@ -1,4 +1,4 @@
// Copyright (c) Alexandre Mutel. All rights reserved.
// Copyright (c) Alexandre Mutel. All rights reserved.
// This file is licensed under the BSD-Clause 2 license.
// See the license.txt file in the project root for more information.
using System;
@@ -192,17 +192,16 @@ namespace Markdig.Syntax.Inlines
/// <returns><c>true</c> if this instance contains a parent of the specified type; <c>false</c> otherwise</returns>
public bool ContainsParentOfType<T>() where T : Inline
{
var delimiter = this as T;
if (delimiter != null)
var inline = this;
while (inline != null)
{
return true;
var delimiter = inline as T;
if (delimiter != null)
{
return true;
}
inline = inline.Parent;
}
if (Parent != null)
{
return Parent.ContainsParentOfType<T>();
}
return false;
}
@@ -213,19 +212,15 @@ namespace Markdig.Syntax.Inlines
/// <returns>An enumeration on the parents of the specified type</returns>
public IEnumerable<T> FindParentOfType<T>() where T : Inline
{
var parent = Parent;
var delimiter = this as T;
if (delimiter != null)
var inline = this;
while (inline != null)
{
yield return delimiter;
}
if (parent != null)
{
foreach (var previous in parent.FindParentOfType<T>())
var delimiter = inline as T;
if (delimiter != null)
{
yield return previous;
yield return delimiter;
}
inline = inline.Parent;
}
}

View File

@@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{061866E2-005C-4D13-A338-EA464BBEC60F}"
ProjectSection(SolutionItems) = preProject
..\appveyor.yml = ..\appveyor.yml
..\changelog.md = ..\changelog.md
..\license.txt = ..\license.txt
..\readme.md = ..\readme.md
EndProjectSection