mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-04 05:44:50 +00:00
Rename several extensions adding a 's' at the end to make them uniform and coherent
This commit is contained in:
@@ -17088,7 +17088,7 @@ namespace Markdig.Tests
|
||||
// <p>The following text <del>is deleted</del></p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 1, "Extensions Strikethrough");
|
||||
TestParser.TestSpec("The following text ~~is deleted~~", "<p>The following text <del>is deleted</del></p>", "emphasisextra");
|
||||
TestParser.TestSpec("The following text ~~is deleted~~", "<p>The following text <del>is deleted</del></p>", "emphasisextras");
|
||||
}
|
||||
}
|
||||
// ## Superscript and Subscript
|
||||
@@ -17110,7 +17110,7 @@ namespace Markdig.Tests
|
||||
// <p>H<sub>2</sub>O is a liquid. 2<sup>10</sup> is 1024</p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 2, "Extensions Superscript and Subscript");
|
||||
TestParser.TestSpec("H~2~O is a liquid. 2^10^ is 1024", "<p>H<sub>2</sub>O is a liquid. 2<sup>10</sup> is 1024</p>", "emphasisextra");
|
||||
TestParser.TestSpec("H~2~O is a liquid. 2^10^ is 1024", "<p>H<sub>2</sub>O is a liquid. 2<sup>10</sup> is 1024</p>", "emphasisextras");
|
||||
}
|
||||
}
|
||||
// ## Inserted
|
||||
@@ -17132,7 +17132,7 @@ namespace Markdig.Tests
|
||||
// <p><ins>Inserted text</ins></p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 3, "Extensions Inserted");
|
||||
TestParser.TestSpec("++Inserted text++", "<p><ins>Inserted text</ins></p>", "emphasisextra");
|
||||
TestParser.TestSpec("++Inserted text++", "<p><ins>Inserted text</ins></p>", "emphasisextras");
|
||||
}
|
||||
}
|
||||
// ## Marked
|
||||
@@ -17154,7 +17154,7 @@ namespace Markdig.Tests
|
||||
// <p><mark>Marked text</mark></p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 4, "Extensions Marked");
|
||||
TestParser.TestSpec("==Marked text==", "<p><mark>Marked text</mark></p>", "emphasisextra");
|
||||
TestParser.TestSpec("==Marked text==", "<p><mark>Marked text</mark></p>", "emphasisextras");
|
||||
}
|
||||
}
|
||||
// # Extensions
|
||||
@@ -17991,7 +17991,7 @@ namespace Markdig.Tests
|
||||
// </ol>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 1, "Extensions Ordered list with alpha letter");
|
||||
TestParser.TestSpec("a. First item\nb. Second item\nc. Last item", "<ol type=\"a\">\n<li>First item</li>\n<li>Second item</li>\n<li>Last item</li>\n</ol>", "listextra");
|
||||
TestParser.TestSpec("a. First item\nb. Second item\nc. Last item", "<ol type=\"a\">\n<li>First item</li>\n<li>Second item</li>\n<li>Last item</li>\n</ol>", "listextras");
|
||||
}
|
||||
}
|
||||
// It works also for uppercase alpha:
|
||||
@@ -18017,7 +18017,7 @@ namespace Markdig.Tests
|
||||
// </ol>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 2, "Extensions Ordered list with alpha letter");
|
||||
TestParser.TestSpec("A. First item\nB. Second item\nC. Last item", "<ol type=\"A\">\n<li>First item</li>\n<li>Second item</li>\n<li>Last item</li>\n</ol>", "listextra");
|
||||
TestParser.TestSpec("A. First item\nB. Second item\nC. Last item", "<ol type=\"A\">\n<li>First item</li>\n<li>Second item</li>\n<li>Last item</li>\n</ol>", "listextras");
|
||||
}
|
||||
}
|
||||
// Like for numbered list, a list can start with a different letter
|
||||
@@ -18041,7 +18041,7 @@ namespace Markdig.Tests
|
||||
// </ol>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 3, "Extensions Ordered list with alpha letter");
|
||||
TestParser.TestSpec("b. First item\nc. Second item", "<ol type=\"a\" start=\"b\">\n<li>First item</li>\n<li>Second item</li>\n</ol>", "listextra");
|
||||
TestParser.TestSpec("b. First item\nc. Second item", "<ol type=\"a\" start=\"b\">\n<li>First item</li>\n<li>Second item</li>\n</ol>", "listextras");
|
||||
}
|
||||
}
|
||||
// A different type of list will break the existing list:
|
||||
@@ -18069,7 +18069,7 @@ namespace Markdig.Tests
|
||||
// </ol>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 4, "Extensions Ordered list with alpha letter");
|
||||
TestParser.TestSpec("a. First item1\nb. Second item\nA. First item2", "<ol type=\"a\">\n<li>First item1</li>\n<li>Second item</li>\n</ol>\n<ol type=\"A\">\n<li>First item2</li>\n</ol>", "listextra");
|
||||
TestParser.TestSpec("a. First item1\nb. Second item\nA. First item2", "<ol type=\"a\">\n<li>First item1</li>\n<li>Second item</li>\n</ol>\n<ol type=\"A\">\n<li>First item2</li>\n</ol>", "listextras");
|
||||
}
|
||||
}
|
||||
// ## Ordered list with roman letter
|
||||
@@ -18099,7 +18099,7 @@ namespace Markdig.Tests
|
||||
// </ol>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 5, "Extensions Ordered list with roman letter");
|
||||
TestParser.TestSpec("i. First item\nii. Second item\niii. Third item\niv. Last item", "<ol type=\"i\">\n<li>First item</li>\n<li>Second item</li>\n<li>Third item</li>\n<li>Last item</li>\n</ol>", "listextra");
|
||||
TestParser.TestSpec("i. First item\nii. Second item\niii. Third item\niv. Last item", "<ol type=\"i\">\n<li>First item</li>\n<li>Second item</li>\n<li>Third item</li>\n<li>Last item</li>\n</ol>", "listextras");
|
||||
}
|
||||
}
|
||||
// It works also for uppercase alpha:
|
||||
@@ -18127,7 +18127,7 @@ namespace Markdig.Tests
|
||||
// </ol>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 6, "Extensions Ordered list with roman letter");
|
||||
TestParser.TestSpec("I. First item\nII. Second item\nIII. Third item\nIV. Last item", "<ol type=\"I\">\n<li>First item</li>\n<li>Second item</li>\n<li>Third item</li>\n<li>Last item</li>\n</ol>", "listextra");
|
||||
TestParser.TestSpec("I. First item\nII. Second item\nIII. Third item\nIV. Last item", "<ol type=\"I\">\n<li>First item</li>\n<li>Second item</li>\n<li>Third item</li>\n<li>Last item</li>\n</ol>", "listextras");
|
||||
}
|
||||
}
|
||||
// Like for numbered list, a list can start with a different letter
|
||||
@@ -18151,7 +18151,7 @@ namespace Markdig.Tests
|
||||
// </ol>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 7, "Extensions Ordered list with roman letter");
|
||||
TestParser.TestSpec("ii. First item\niii. Second item", "<ol type=\"i\" start=\"ii\">\n<li>First item</li>\n<li>Second item</li>\n</ol>", "listextra");
|
||||
TestParser.TestSpec("ii. First item\niii. Second item", "<ol type=\"i\" start=\"ii\">\n<li>First item</li>\n<li>Second item</li>\n</ol>", "listextras");
|
||||
}
|
||||
}
|
||||
// # Extensions
|
||||
@@ -18182,7 +18182,7 @@ namespace Markdig.Tests
|
||||
// </figure>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 1, "Extensions Figures");
|
||||
TestParser.TestSpec("^^^\nThis is a figure\n^^^ This is a *caption*", "<figure>\n<p>This is a figure</p>\n<figcaption>This is a <em>caption</em></figcaption>\n</figure>", "figures+footers+cites");
|
||||
TestParser.TestSpec("^^^\nThis is a figure\n^^^ This is a *caption*", "<figure>\n<p>This is a figure</p>\n<figcaption>This is a <em>caption</em></figcaption>\n</figure>", "figures+footers+citations");
|
||||
}
|
||||
}
|
||||
// ## Footers
|
||||
@@ -18206,7 +18206,7 @@ namespace Markdig.Tests
|
||||
// multi-line</footer>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 2, "Extensions Footers");
|
||||
TestParser.TestSpec("^^ This is a footer\n^^ multi-line", "<footer>This is a footer\nmulti-line</footer>", "figures+footers+cites");
|
||||
TestParser.TestSpec("^^ This is a footer\n^^ multi-line", "<footer>This is a footer\nmulti-line</footer>", "figures+footers+citations");
|
||||
}
|
||||
}
|
||||
// ## Cite
|
||||
@@ -18228,7 +18228,7 @@ namespace Markdig.Tests
|
||||
// <p>This is a <cite>citation of someone</cite></p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 3, "Extensions Cite");
|
||||
TestParser.TestSpec("This is a \"\"citation of someone\"\"", "<p>This is a <cite>citation of someone</cite></p>", "figures+footers+cites");
|
||||
TestParser.TestSpec("This is a \"\"citation of someone\"\"", "<p>This is a <cite>citation of someone</cite></p>", "figures+footers+citations");
|
||||
}
|
||||
}
|
||||
// # Extensions
|
||||
@@ -18254,7 +18254,7 @@ namespace Markdig.Tests
|
||||
// <p>This is a <span class="math">math block</span></p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 1, "Extensions Math Inline");
|
||||
TestParser.TestSpec("This is a $math block$", "<p>This is a <span class=\"math\">math block</span></p>", "math");
|
||||
TestParser.TestSpec("This is a $math block$", "<p>This is a <span class=\"math\">math block</span></p>", "mathematics");
|
||||
}
|
||||
}
|
||||
// Or by `$$...$$` embracing it by:
|
||||
@@ -18274,7 +18274,7 @@ namespace Markdig.Tests
|
||||
// <p>This is a <span class="math">math block</span></p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 2, "Extensions Math Inline");
|
||||
TestParser.TestSpec("This is a $$math block$$", "<p>This is a <span class=\"math\">math block</span></p>", "math");
|
||||
TestParser.TestSpec("This is a $$math block$$", "<p>This is a <span class=\"math\">math block</span></p>", "mathematics");
|
||||
}
|
||||
}
|
||||
// The opening `$` and closing `$` is following the rules of the emphasis delimiter `_`:
|
||||
@@ -18294,7 +18294,7 @@ namespace Markdig.Tests
|
||||
// <p>This is not a $ math block $</p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 3, "Extensions Math Inline");
|
||||
TestParser.TestSpec("This is not a $ math block $", "<p>This is not a $ math block $</p>", "math");
|
||||
TestParser.TestSpec("This is not a $ math block $", "<p>This is not a $ math block $</p>", "mathematics");
|
||||
}
|
||||
}
|
||||
// For the opening `$` it requires a space or a punctuation before (but cannot be used within a word):
|
||||
@@ -18314,7 +18314,7 @@ namespace Markdig.Tests
|
||||
// <p>This is not a m$ath block$</p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 4, "Extensions Math Inline");
|
||||
TestParser.TestSpec("This is not a m$ath block$", "<p>This is not a m$ath block$</p>", "math");
|
||||
TestParser.TestSpec("This is not a m$ath block$", "<p>This is not a m$ath block$</p>", "mathematics");
|
||||
}
|
||||
}
|
||||
// For the closing `$` it requires a space after or a punctuation (but cannot be preceded by a space and cannot be used within a word):
|
||||
@@ -18334,7 +18334,7 @@ namespace Markdig.Tests
|
||||
// <p>This is not a $math bloc$k</p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 5, "Extensions Math Inline");
|
||||
TestParser.TestSpec("This is not a $math bloc$k", "<p>This is not a $math bloc$k</p>", "math");
|
||||
TestParser.TestSpec("This is not a $math bloc$k", "<p>This is not a $math bloc$k</p>", "mathematics");
|
||||
}
|
||||
}
|
||||
// For the closing `$` it requires a space after or a punctuation (but cannot be preceded by a space and cannot be used within a word):
|
||||
@@ -18354,7 +18354,7 @@ namespace Markdig.Tests
|
||||
// <p>This is should not match a 16$ or a $15</p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 6, "Extensions Math Inline");
|
||||
TestParser.TestSpec("This is should not match a 16$ or a $15", "<p>This is should not match a 16$ or a $15</p>", "math");
|
||||
TestParser.TestSpec("This is should not match a 16$ or a $15", "<p>This is should not match a 16$ or a $15</p>", "mathematics");
|
||||
}
|
||||
}
|
||||
// A `$` can be escaped between a math inline block by using the escape `\\`
|
||||
@@ -18374,7 +18374,7 @@ namespace Markdig.Tests
|
||||
// <p>This is a <span class="math">math \$ block</span></p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 7, "Extensions Math Inline");
|
||||
TestParser.TestSpec("This is a $math \\$ block$", "<p>This is a <span class=\"math\">math \\$ block</span></p>", "math");
|
||||
TestParser.TestSpec("This is a $math \\$ block$", "<p>This is a <span class=\"math\">math \\$ block</span></p>", "mathematics");
|
||||
}
|
||||
}
|
||||
// At most, two `$` will be matched for the opening and closing:
|
||||
@@ -18394,7 +18394,7 @@ namespace Markdig.Tests
|
||||
// <p>This is a <span class="math">$math block$</span></p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 8, "Extensions Math Inline");
|
||||
TestParser.TestSpec("This is a $$$math block$$$", "<p>This is a <span class=\"math\">$math block$</span></p>", "math");
|
||||
TestParser.TestSpec("This is a $$$math block$$$", "<p>This is a <span class=\"math\">$math block$</span></p>", "mathematics");
|
||||
}
|
||||
}
|
||||
// A mathematic block takes precedence over standard emphasis `*` `_`:
|
||||
@@ -18414,7 +18414,7 @@ namespace Markdig.Tests
|
||||
// <p>This is *a <span class="math">math* block</span></p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 9, "Extensions Math Inline");
|
||||
TestParser.TestSpec("This is *a $math* block$", "<p>This is *a <span class=\"math\">math* block</span></p>", "math");
|
||||
TestParser.TestSpec("This is *a $math* block$", "<p>This is *a <span class=\"math\">math* block</span></p>", "mathematics");
|
||||
}
|
||||
}
|
||||
// ## Math Block
|
||||
@@ -18446,7 +18446,7 @@ namespace Markdig.Tests
|
||||
// </div>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 10, "Extensions Math Block");
|
||||
TestParser.TestSpec("$$\n\\begin{equation}\n \\int_0^\\infty \\frac{x^3}{e^x-1}\\,dx = \\frac{\\pi^4}{15}\n \\label{eq:sample}\n\\end{equation}\n$$", "<div class=\"math\">\\begin{equation}\n \\int_0^\\infty \\frac{x^3}{e^x-1}\\,dx = \\frac{\\pi^4}{15}\n \\label{eq:sample}\n\\end{equation}\n</div>", "math");
|
||||
TestParser.TestSpec("$$\n\\begin{equation}\n \\int_0^\\infty \\frac{x^3}{e^x-1}\\,dx = \\frac{\\pi^4}{15}\n \\label{eq:sample}\n\\end{equation}\n$$", "<div class=\"math\">\\begin{equation}\n \\int_0^\\infty \\frac{x^3}{e^x-1}\\,dx = \\frac{\\pi^4}{15}\n \\label{eq:sample}\n\\end{equation}\n</div>", "mathematics");
|
||||
}
|
||||
}
|
||||
// # Extensions
|
||||
@@ -18583,7 +18583,7 @@ namespace Markdig.Tests
|
||||
// <p><iframe src="https://player.vimeo.com/video/8607834" width="500" height="281" frameborder="0" allowfullscreen></iframe></p>
|
||||
|
||||
Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 1, "Extensions Media links");
|
||||
TestParser.TestSpec("\n\n", "<p><iframe src=\"https://www.youtube.com/embed/mswPy5bt3TQ\" width=\"500\" height=\"281\" frameborder=\"0\" allowfullscreen></iframe></p>\n<p><iframe src=\"https://player.vimeo.com/video/8607834\" width=\"500\" height=\"281\" frameborder=\"0\" allowfullscreen></iframe></p>", "medias");
|
||||
TestParser.TestSpec("\n\n", "<p><iframe src=\"https://www.youtube.com/embed/mswPy5bt3TQ\" width=\"500\" height=\"281\" frameborder=\"0\" allowfullscreen></iframe></p>\n<p><iframe src=\"https://player.vimeo.com/video/8607834\" width=\"500\" height=\"281\" frameborder=\"0\" allowfullscreen></iframe></p>", "medialinks");
|
||||
}
|
||||
}
|
||||
// # Extensions
|
||||
|
||||
@@ -42,18 +42,18 @@ SOFTWARE.
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("PipeTableSpecs.md"), "pipetables"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("FootnotesSpecs.md"), "footnotes"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("GenericAttributesSpecs.md"), "attributes"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("EmphasisExtraSpecs.md"), "emphasisextra"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("EmphasisExtraSpecs.md"), "emphasisextras"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("HardlineBreakSpecs.md"), "hardlinebreak"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("GridTableSpecs.md"), "gridtables"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("CustomContainerSpecs.md"), "customcontainers+attributes"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("DefinitionListSpecs.md"), "definitionlists+attributes"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("EmojiSpecs.md"), "emojis"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("AbbreviationSpecs.md"), "abbreviations"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("ListExtraSpecs.md"), "listextra"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("FigureFooterAndCiteSpecs.md"), "figures+footers+cites"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("MathSpecs.md"), "math"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("ListExtraSpecs.md"), "listextras"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("FigureFooterAndCiteSpecs.md"), "figures+footers+citations"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("MathSpecs.md"), "mathematics"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("BootstrapSpecs.md"), "bootstrap+pipetables+figures+attributes"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("MediaSpecs.md"), "medias"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("MediaSpecs.md"), "medialinks"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("SmartyPantsSpecs.md"), "smartypants"),
|
||||
new KeyValuePair<string, string>(Host.ResolvePath("AutoIdentifierSpecs.md"), "autoidentifiers"),
|
||||
};
|
||||
|
||||
@@ -42,20 +42,20 @@ namespace Markdig.Tests
|
||||
yield return new KeyValuePair<string, MarkdownPipeline>("default", new MarkdownPipelineBuilder().Build());
|
||||
|
||||
yield return new KeyValuePair<string, MarkdownPipeline>("advanced", new MarkdownPipelineBuilder() // Use similar to advanced extension without auto-identifier
|
||||
.UseAbbreviation()
|
||||
//.UseAutoIdentifier()
|
||||
.UseCite()
|
||||
.UseCustomContainer()
|
||||
.UseDefinitionList()
|
||||
.UseEmphasisExtra()
|
||||
.UseFigure()
|
||||
.UseFooter()
|
||||
.UseAbbreviations()
|
||||
//.UseAutoIdentifiers()
|
||||
.UseCitations()
|
||||
.UseCustomContainers()
|
||||
.UseDefinitionLists()
|
||||
.UseEmphasisExtras()
|
||||
.UseFigures()
|
||||
.UseFooters()
|
||||
.UseFootnotes()
|
||||
.UseGridTable()
|
||||
.UseMath()
|
||||
.UseMedia()
|
||||
.UsePipeTable()
|
||||
.UseListExtra()
|
||||
.UseGridTables()
|
||||
.UseMathematics()
|
||||
.UseMediaLinks()
|
||||
.UsePipeTables()
|
||||
.UseListExtras()
|
||||
.UseGenericAttributes().Build());
|
||||
|
||||
yield break;
|
||||
|
||||
@@ -21,8 +21,8 @@ Later in a text we are using HTML and it becomes an abbr tag HTML
|
||||
//> titi toto
|
||||
//");
|
||||
|
||||
//var result = Markdown.ToHtml(text, new MarkdownPipeline().UseFootnotes().UseEmphasisExtra());
|
||||
var result = Markdown.ToHtml(text, new MarkdownPipelineBuilder().UseAbbreviation().Build());
|
||||
//var result = Markdown.ToHtml(text, new MarkdownPipeline().UseFootnotes().UseEmphasisExtras());
|
||||
var result = Markdown.ToHtml(text, new MarkdownPipelineBuilder().UseAbbreviations().Build());
|
||||
//File.WriteAllText("test.html", result, Encoding.UTF8);
|
||||
Console.WriteLine(result);
|
||||
}
|
||||
|
||||
@@ -7,13 +7,13 @@ using Markdig.Renderers;
|
||||
using Markdig.Renderers.Html.Inlines;
|
||||
using Markdig.Syntax.Inlines;
|
||||
|
||||
namespace Markdig.Extensions.Cites
|
||||
namespace Markdig.Extensions.Citations
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension for cite ""...""
|
||||
/// </summary>
|
||||
/// <seealso cref="Markdig.IMarkdownExtension" />
|
||||
public class CiteExtension : IMarkdownExtension
|
||||
public class CitationExtension : IMarkdownExtension
|
||||
{
|
||||
public void Setup(MarkdownPipelineBuilder pipeline)
|
||||
{
|
||||
@@ -7,7 +7,7 @@ using Markdig.Renderers;
|
||||
using Markdig.Renderers.Html.Inlines;
|
||||
using Markdig.Syntax.Inlines;
|
||||
|
||||
namespace Markdig.Extensions.EmphasisExtra
|
||||
namespace Markdig.Extensions.EmphasisExtras
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension for strikethrough, subscript, superscript, inserted and marked.
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace Markdig.Extensions.EmphasisExtra
|
||||
namespace Markdig.Extensions.EmphasisExtras
|
||||
{
|
||||
/// <summary>
|
||||
/// Options for enabling support for extra emphasis.
|
||||
@@ -2,7 +2,6 @@
|
||||
// This file is licensed under the BSD-Clause 2 license.
|
||||
// See the license.txt file in the project root for more information.
|
||||
|
||||
using Markdig.Extensions.Cites;
|
||||
using Markdig.Extensions.Footers;
|
||||
using Markdig.Renderers;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
using Markdig.Parsers;
|
||||
using Markdig.Renderers;
|
||||
|
||||
namespace Markdig.Extensions.ListExtra
|
||||
namespace Markdig.Extensions.ListExtras
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension for adding new type of list items (a., A., i., I.)
|
||||
@@ -5,7 +5,7 @@
|
||||
using Markdig.Helpers;
|
||||
using Markdig.Parsers;
|
||||
|
||||
namespace Markdig.Extensions.ListExtra
|
||||
namespace Markdig.Extensions.ListExtras
|
||||
{
|
||||
/// <summary>
|
||||
/// Parser that adds supports for parsing alpha/roman list items (e.g: `a)` or `a.` or `ii.` or `II.`)
|
||||
@@ -1,25 +1,26 @@
|
||||
// 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;
|
||||
using Markdig.Renderers;
|
||||
using Markdig.Renderers.Html;
|
||||
using Markdig.Renderers.Html.Inlines;
|
||||
using Markdig.Syntax.Inlines;
|
||||
|
||||
namespace Markdig.Extensions.Medias
|
||||
namespace Markdig.Extensions.MediaLinks
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension for extending image Markdown links in case a video or an audio file is linked and output proper link.
|
||||
/// </summary>
|
||||
/// <seealso cref="Markdig.IMarkdownExtension" />
|
||||
public class MediaExtension : IMarkdownExtension
|
||||
public class MediaLinkExtension : IMarkdownExtension
|
||||
{
|
||||
public MediaExtension() : this(new MediaOptions())
|
||||
public MediaLinkExtension() : this(new MediaOptions())
|
||||
{
|
||||
}
|
||||
|
||||
public MediaExtension(MediaOptions options)
|
||||
public MediaLinkExtension(MediaOptions options)
|
||||
{
|
||||
Options = options ?? new MediaOptions();
|
||||
}
|
||||
@@ -1,13 +1,14 @@
|
||||
// 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;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Markdig.Extensions.Medias
|
||||
namespace Markdig.Extensions.MediaLinks
|
||||
{
|
||||
/// <summary>
|
||||
/// Options for the <see cref="MediaExtension"/>.
|
||||
/// Options for the <see cref="MediaLinkExtension"/>.
|
||||
/// </summary>
|
||||
public class MediaOptions
|
||||
{
|
||||
@@ -6,19 +6,19 @@ using System;
|
||||
using Markdig.Extensions.Abbreviations;
|
||||
using Markdig.Extensions.AutoIdentifiers;
|
||||
using Markdig.Extensions.Bootstrap;
|
||||
using Markdig.Extensions.Cites;
|
||||
using Markdig.Extensions.Citations;
|
||||
using Markdig.Extensions.CustomContainers;
|
||||
using Markdig.Extensions.DefinitionLists;
|
||||
using Markdig.Extensions.Emoji;
|
||||
using Markdig.Extensions.EmphasisExtra;
|
||||
using Markdig.Extensions.EmphasisExtras;
|
||||
using Markdig.Extensions.Figures;
|
||||
using Markdig.Extensions.Footers;
|
||||
using Markdig.Extensions.Footnotes;
|
||||
using Markdig.Extensions.GenericAttributes;
|
||||
using Markdig.Extensions.Hardlines;
|
||||
using Markdig.Extensions.ListExtra;
|
||||
using Markdig.Extensions.ListExtras;
|
||||
using Markdig.Extensions.Mathematics;
|
||||
using Markdig.Extensions.Medias;
|
||||
using Markdig.Extensions.MediaLinks;
|
||||
using Markdig.Extensions.SmartyPants;
|
||||
using Markdig.Extensions.Tables;
|
||||
using Markdig.Parsers;
|
||||
@@ -39,20 +39,20 @@ namespace Markdig
|
||||
public static MarkdownPipelineBuilder UseAdvancedExtensions(this MarkdownPipelineBuilder pipeline)
|
||||
{
|
||||
return pipeline
|
||||
.UseAbbreviation()
|
||||
.UseAutoIdentifier()
|
||||
.UseCite()
|
||||
.UseCustomContainer()
|
||||
.UseDefinitionList()
|
||||
.UseEmphasisExtra()
|
||||
.UseFigure()
|
||||
.UseFooter()
|
||||
.UseAbbreviations()
|
||||
.UseAutoIdentifiers()
|
||||
.UseCitations()
|
||||
.UseCustomContainers()
|
||||
.UseDefinitionLists()
|
||||
.UseEmphasisExtras()
|
||||
.UseFigures()
|
||||
.UseFooters()
|
||||
.UseFootnotes()
|
||||
.UseGridTable()
|
||||
.UseMath()
|
||||
.UseMedia()
|
||||
.UsePipeTable()
|
||||
.UseListExtra()
|
||||
.UseGridTables()
|
||||
.UseMathematics()
|
||||
.UseMediaLinks()
|
||||
.UsePipeTables()
|
||||
.UseListExtras()
|
||||
.UseGenericAttributes(); // Must be last as it is one parser that is modifying other parsers
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Markdig
|
||||
/// </summary>
|
||||
/// <param name="pipeline">The pipeline.</param>
|
||||
/// <returns>The modified pipeline</returns>
|
||||
public static MarkdownPipelineBuilder UseCustomContainer(this MarkdownPipelineBuilder pipeline)
|
||||
public static MarkdownPipelineBuilder UseCustomContainers(this MarkdownPipelineBuilder pipeline)
|
||||
{
|
||||
pipeline.Extensions.AddIfNotAlready<CustomContainerExtension>();
|
||||
return pipeline;
|
||||
@@ -75,11 +75,11 @@ namespace Markdig
|
||||
/// <returns>
|
||||
/// The modified pipeline
|
||||
/// </returns>
|
||||
public static MarkdownPipelineBuilder UseMedia(this MarkdownPipelineBuilder pipeline, MediaOptions options = null)
|
||||
public static MarkdownPipelineBuilder UseMediaLinks(this MarkdownPipelineBuilder pipeline, MediaOptions options = null)
|
||||
{
|
||||
if (!pipeline.Extensions.Contains<MediaExtension>())
|
||||
if (!pipeline.Extensions.Contains<MediaLinkExtension>())
|
||||
{
|
||||
pipeline.Extensions.Add(new MediaExtension(options));
|
||||
pipeline.Extensions.Add(new MediaLinkExtension(options));
|
||||
}
|
||||
return pipeline;
|
||||
}
|
||||
@@ -92,7 +92,7 @@ namespace Markdig
|
||||
/// <returns>
|
||||
/// The modified pipeline
|
||||
/// </returns>
|
||||
public static MarkdownPipelineBuilder UseAutoIdentifier(this MarkdownPipelineBuilder pipeline, AutoIdentifierOptions options = AutoIdentifierOptions.Default)
|
||||
public static MarkdownPipelineBuilder UseAutoIdentifiers(this MarkdownPipelineBuilder pipeline, AutoIdentifierOptions options = AutoIdentifierOptions.Default)
|
||||
{
|
||||
if (!pipeline.Extensions.Contains<AutoIdentifierExtension>())
|
||||
{
|
||||
@@ -134,7 +134,7 @@ namespace Markdig
|
||||
/// </summary>
|
||||
/// <param name="pipeline">The pipeline.</param>
|
||||
/// <returns>The modified pipeline</returns>
|
||||
public static MarkdownPipelineBuilder UseMath(this MarkdownPipelineBuilder pipeline)
|
||||
public static MarkdownPipelineBuilder UseMathematics(this MarkdownPipelineBuilder pipeline)
|
||||
{
|
||||
pipeline.Extensions.AddIfNotAlready<MathExtension>();
|
||||
return pipeline;
|
||||
@@ -145,7 +145,7 @@ namespace Markdig
|
||||
/// </summary>
|
||||
/// <param name="pipeline">The pipeline.</param>
|
||||
/// <returns>The modified pipeline</returns>
|
||||
public static MarkdownPipelineBuilder UseFigure(this MarkdownPipelineBuilder pipeline)
|
||||
public static MarkdownPipelineBuilder UseFigures(this MarkdownPipelineBuilder pipeline)
|
||||
{
|
||||
pipeline.Extensions.AddIfNotAlready<FigureExtension>();
|
||||
return pipeline;
|
||||
@@ -156,7 +156,7 @@ namespace Markdig
|
||||
/// </summary>
|
||||
/// <param name="pipeline">The pipeline.</param>
|
||||
/// <returns>The modified pipeline</returns>
|
||||
public static MarkdownPipelineBuilder UseAbbreviation(this MarkdownPipelineBuilder pipeline)
|
||||
public static MarkdownPipelineBuilder UseAbbreviations(this MarkdownPipelineBuilder pipeline)
|
||||
{
|
||||
pipeline.Extensions.AddIfNotAlready<AbbreviationExtension>();
|
||||
return pipeline;
|
||||
@@ -167,7 +167,7 @@ namespace Markdig
|
||||
/// </summary>
|
||||
/// <param name="pipeline">The pipeline.</param>
|
||||
/// <returns>The modified pipeline</returns>
|
||||
public static MarkdownPipelineBuilder UseDefinitionList(this MarkdownPipelineBuilder pipeline)
|
||||
public static MarkdownPipelineBuilder UseDefinitionLists(this MarkdownPipelineBuilder pipeline)
|
||||
{
|
||||
pipeline.Extensions.AddIfNotAlready<DefinitionListExtension>();
|
||||
return pipeline;
|
||||
@@ -181,7 +181,7 @@ namespace Markdig
|
||||
/// <returns>
|
||||
/// The modified pipeline
|
||||
/// </returns>
|
||||
public static MarkdownPipelineBuilder UsePipeTable(this MarkdownPipelineBuilder pipeline, PipeTableOptions options = null)
|
||||
public static MarkdownPipelineBuilder UsePipeTables(this MarkdownPipelineBuilder pipeline, PipeTableOptions options = null)
|
||||
{
|
||||
if (!pipeline.Extensions.Contains<PipeTableExtension>())
|
||||
{
|
||||
@@ -195,7 +195,7 @@ namespace Markdig
|
||||
/// </summary>
|
||||
/// <param name="pipeline">The pipeline.</param>
|
||||
/// <returns>The modified pipeline</returns>
|
||||
public static MarkdownPipelineBuilder UseGridTable(this MarkdownPipelineBuilder pipeline)
|
||||
public static MarkdownPipelineBuilder UseGridTables(this MarkdownPipelineBuilder pipeline)
|
||||
{
|
||||
pipeline.Extensions.AddIfNotAlready<GridTableExtension>();
|
||||
return pipeline;
|
||||
@@ -207,9 +207,9 @@ namespace Markdig
|
||||
/// </summary>
|
||||
/// <param name="pipeline">The pipeline.</param>
|
||||
/// <returns>The modified pipeline</returns>
|
||||
public static MarkdownPipelineBuilder UseCite(this MarkdownPipelineBuilder pipeline)
|
||||
public static MarkdownPipelineBuilder UseCitations(this MarkdownPipelineBuilder pipeline)
|
||||
{
|
||||
pipeline.Extensions.AddIfNotAlready<CiteExtension>();
|
||||
pipeline.Extensions.AddIfNotAlready<CitationExtension>();
|
||||
return pipeline;
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace Markdig
|
||||
/// </summary>
|
||||
/// <param name="pipeline">The pipeline.</param>
|
||||
/// <returns>The modified pipeline</returns>
|
||||
public static MarkdownPipelineBuilder UseFooter(this MarkdownPipelineBuilder pipeline)
|
||||
public static MarkdownPipelineBuilder UseFooters(this MarkdownPipelineBuilder pipeline)
|
||||
{
|
||||
pipeline.Extensions.AddIfNotAlready<FooterExtension>();
|
||||
return pipeline;
|
||||
@@ -254,7 +254,7 @@ namespace Markdig
|
||||
/// <returns>
|
||||
/// The modified pipeline
|
||||
/// </returns>
|
||||
public static MarkdownPipelineBuilder UseEmphasisExtra(this MarkdownPipelineBuilder pipeline, EmphasisExtraOptions options = EmphasisExtraOptions.Default)
|
||||
public static MarkdownPipelineBuilder UseEmphasisExtras(this MarkdownPipelineBuilder pipeline, EmphasisExtraOptions options = EmphasisExtraOptions.Default)
|
||||
{
|
||||
if (!pipeline.Extensions.Contains<EmphasisExtraExtension>())
|
||||
{
|
||||
@@ -270,7 +270,7 @@ namespace Markdig
|
||||
/// <returns>
|
||||
/// The modified pipeline
|
||||
/// </returns>
|
||||
public static MarkdownPipelineBuilder UseListExtra(this MarkdownPipelineBuilder pipeline)
|
||||
public static MarkdownPipelineBuilder UseListExtras(this MarkdownPipelineBuilder pipeline)
|
||||
{
|
||||
pipeline.Extensions.AddIfNotAlready<ListExtraExtension>();
|
||||
return pipeline;
|
||||
@@ -322,7 +322,7 @@ namespace Markdig
|
||||
/// <summary>
|
||||
/// Configures the pipeline using a string that defines the extensions to activate.
|
||||
/// </summary>
|
||||
/// <param name="pipeline">The pipeline (e.g: advanced for <see cref="UseAdvancedExtensions"/>, pipetables+gridtables for <see cref="UsePipeTable"/> and <see cref="UseGridTable"/></param>
|
||||
/// <param name="pipeline">The pipeline (e.g: advanced for <see cref="UseAdvancedExtensions"/>, pipetables+gridtables for <see cref="UsePipeTables"/> and <see cref="UseGridTables"/></param>
|
||||
/// <param name="extensions">The extensions to activate as a string</param>
|
||||
/// <returns>The modified pipeline</returns>
|
||||
public static MarkdownPipelineBuilder Configure(this MarkdownPipelineBuilder pipeline, string extensions)
|
||||
@@ -340,13 +340,13 @@ namespace Markdig
|
||||
pipeline.UseAdvancedExtensions();
|
||||
break;
|
||||
case "pipetables":
|
||||
pipeline.UsePipeTable();
|
||||
pipeline.UsePipeTables();
|
||||
break;
|
||||
case "emphasisextra":
|
||||
pipeline.UseEmphasisExtra();
|
||||
case "emphasisextras":
|
||||
pipeline.UseEmphasisExtras();
|
||||
break;
|
||||
case "listextra":
|
||||
pipeline.UseListExtra();
|
||||
case "listextras":
|
||||
pipeline.UseListExtras();
|
||||
break;
|
||||
case "hardlinebreak":
|
||||
pipeline.UseSoftlineBreakAsHardlineBreak();
|
||||
@@ -355,46 +355,46 @@ namespace Markdig
|
||||
pipeline.UseFootnotes();
|
||||
break;
|
||||
case "footers":
|
||||
pipeline.UseFooter();
|
||||
pipeline.UseFooters();
|
||||
break;
|
||||
case "cites":
|
||||
pipeline.UseCite();
|
||||
case "citations":
|
||||
pipeline.UseCitations();
|
||||
break;
|
||||
case "attributes":
|
||||
pipeline.UseGenericAttributes();
|
||||
break;
|
||||
case "gridtables":
|
||||
pipeline.UseGridTable();
|
||||
pipeline.UseGridTables();
|
||||
break;
|
||||
case "abbreviations":
|
||||
pipeline.UseAbbreviation();
|
||||
pipeline.UseAbbreviations();
|
||||
break;
|
||||
case "emojis":
|
||||
pipeline.UseEmojiAndSmiley();
|
||||
break;
|
||||
case "definitionlists":
|
||||
pipeline.UseDefinitionList();
|
||||
pipeline.UseDefinitionLists();
|
||||
break;
|
||||
case "customcontainers":
|
||||
pipeline.UseCustomContainer();
|
||||
pipeline.UseCustomContainers();
|
||||
break;
|
||||
case "figures":
|
||||
pipeline.UseFigure();
|
||||
pipeline.UseFigures();
|
||||
break;
|
||||
case "math":
|
||||
pipeline.UseMath();
|
||||
case "mathematics":
|
||||
pipeline.UseMathematics();
|
||||
break;
|
||||
case "bootstrap":
|
||||
pipeline.UseBootstrap();
|
||||
break;
|
||||
case "medias":
|
||||
pipeline.UseMedia();
|
||||
case "medialinks":
|
||||
pipeline.UseMediaLinks();
|
||||
break;
|
||||
case "smartypants":
|
||||
pipeline.UseSmartyPants();
|
||||
break;
|
||||
case "autoidentifiers":
|
||||
pipeline.UseAutoIdentifier();
|
||||
pipeline.UseAutoIdentifiers();
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException($"unknown extension {extension}");
|
||||
|
||||
Reference in New Issue
Block a user