Move Markdown types to Radzen.Documents.Markdown namespace

Relocate parser/AST types from Radzen.Blazor/Markdown to
Radzen.Blazor/Documents/Markdown with namespace Radzen.Documents.Markdown.
Move rendering classes (BlazorMarkdownRenderer, BlazorMarkdownRendererOptions,
RadzenAnchor) to Radzen.Blazor/Rendering with namespace Radzen.Blazor.Rendering.
Update all using directives in production and test code. Document the namespace
change as a breaking change in v11.0.0 changelog.
This commit is contained in:
Atanas Korchev
2026-03-26 18:38:19 +02:00
committed by Vladimir Enchev
parent 30d1f9cf2a
commit 36eae188b1
75 changed files with 88 additions and 73 deletions

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class BlockQuoteTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class CodeTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class EmphasisTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class FencedCodeBlockTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class HardLineBreakTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class HeadingTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class HtmlBlockTests
{

View File

@@ -1,7 +1,7 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class HtmlInlineTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class ImageTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class IndentedCodeBlockTests
{

View File

@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class LinkTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class ListItemTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class ListTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class ParagraphTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class SoftLineBreakTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class StrongTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class TableTests
{

View File

@@ -1,6 +1,6 @@
using Xunit;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class ThematicBreakTests
{

View File

@@ -2,7 +2,7 @@ using System;
using System.Text;
using System.Xml;
namespace Radzen.Blazor.Markdown.Tests;
namespace Radzen.Documents.Markdown.Tests;
public class XmlVisitor : NodeVisitorBase, IDisposable
{

View File

@@ -1,6 +1,6 @@
using System.Text.RegularExpressions;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a markdown ATX heading: <c># Heading</c>.

View File

@@ -1,4 +1,4 @@
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
#nullable enable

View File

@@ -2,7 +2,7 @@
using System;
using System.Collections.Generic;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
#nullable enable
/// <summary>

View File

@@ -1,4 +1,4 @@
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents the result of matching a block during parsing.

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
#nullable enable

View File

@@ -1,6 +1,6 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>

View File

@@ -1,4 +1,4 @@
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents the result of attempting to start a new block.

View File

@@ -1,4 +1,4 @@
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
static class CharExtensions
{

View File

@@ -1,6 +1,6 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a markdown inline code block: <c>`code`</c>.

View File

@@ -1,6 +1,6 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a markdown document.

View File

@@ -1,6 +1,6 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents an emphasis element in a markdown document: <c>_emphasis_</c> or <c>*emphasis*</c>.

View File

@@ -1,7 +1,7 @@
using System;
using System.Text.RegularExpressions;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a fenced code block in a markdown document: <c>```</c> or <c>~~~</c>.

View File

@@ -1,7 +1,7 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// A base class for all heading elements.

View File

@@ -1,7 +1,7 @@
using System;
using System.Text.RegularExpressions;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents an HTML block.

View File

@@ -1,6 +1,6 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents an inline HTML element.

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a block node that has inline children.

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a markdown node that can be visited by a <see cref="INodeVisitor"/>.

View File

@@ -1,4 +1,4 @@
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>

View File

@@ -1,6 +1,6 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents an inline image element: <c>![Alt text](/path/to/img.jpg "Optional title")</c>

View File

@@ -2,7 +2,7 @@ using System;
using System.Linq;
using System.Text.RegularExpressions;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a markdown indented code block.

View File

@@ -1,4 +1,4 @@
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Base class for markdown inline nodes.

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Base class for inline elements that contain other inline elements.

View File

@@ -3,7 +3,7 @@ using System.Text;
using System.Collections.Generic;
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
class InlineParser
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
class InlineVisitor(Dictionary<string, LinkReference> references) : NodeVisitorBase
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Base class for markdown leaf block nodes.

View File

@@ -1,6 +1,6 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a line break node. Line breaks are usually empty lines and are used to separate paragraphs.

View File

@@ -1,6 +1,6 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a link element: <c>[Link text](/path/to/page "Optional title")</c>

View File

@@ -1,4 +1,4 @@
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
class LinkReference
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
class LinkReferenceParser(BlockParser parser) : NodeVisitorBase
{

View File

@@ -1,4 +1,4 @@
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Base class for list elements (ordered and unordered).

View File

@@ -2,7 +2,7 @@ using System;
using System.Globalization;
using System.Text.RegularExpressions;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
#nullable enable

View File

@@ -1,4 +1,4 @@
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Parses a Markdown document.

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Base class for visitors that traverse a Markdown document.

View File

@@ -1,6 +1,6 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents an ordered list: <c>1. item</c>.

View File

@@ -1,7 +1,7 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a paragraph node.

View File

@@ -1,4 +1,4 @@
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a position in a markdown document.

View File

@@ -1,4 +1,4 @@
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a range in a markdown document.

View File

@@ -1,6 +1,6 @@
using System.Text.RegularExpressions;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a setext heading node. Setext headings are headings that are underlined with equal signs for level 1 headings and dashes for level 2 headings.

View File

@@ -1,6 +1,6 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a soft line break node. Soft line breaks are usually used to separate lines in a paragraph.

View File

@@ -1,4 +1,4 @@
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
static class StringExtensions
{

View File

@@ -1,6 +1,6 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a strong node: <c>**strong**</c>.

View File

@@ -2,7 +2,7 @@ using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a table in a Markdown document.

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a table cell in a Markdown table.

View File

@@ -1,4 +1,4 @@
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// The alignment of a table cell.

View File

@@ -1,6 +1,6 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a table header row in a Markdown table.

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a table row in a Markdown table.

View File

@@ -1,6 +1,6 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a text node.

View File

@@ -1,7 +1,7 @@
using System;
using System.Text.RegularExpressions;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents a thematic break node: <c>***</c>, <c>---</c>, or <c>___</c>.

View File

@@ -1,6 +1,6 @@
using System;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Documents.Markdown;
/// <summary>
/// Represents an unordered list: <c>- item</c>.

View File

@@ -1,7 +1,8 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.AspNetCore.Components.RenderTree;
using Radzen.Blazor.Markdown;
using Radzen.Blazor.Rendering;
using Radzen.Documents.Markdown;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

View File

@@ -4,8 +4,9 @@ using System.Globalization;
using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Rendering;
using Radzen.Documents.Markdown;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Blazor.Rendering;
#nullable enable
@@ -314,7 +315,7 @@ internal class BlazorMarkdownRenderer(BlazorMarkdownRendererOptions options, Ren
}
/// <inheritdoc />
public override void VisitText(Text text)
public override void VisitText(Radzen.Documents.Markdown.Text text)
{
builder.AddContent(0, text.Value);
}

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Blazor.Rendering;
#nullable enable

View File

@@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.JSInterop;
namespace Radzen.Blazor.Markdown;
namespace Radzen.Blazor.Rendering;
#nullable enable

View File

@@ -1,6 +1,19 @@
@page "/changelog"
<div class="changelog">
<RadzenText Anchor="changelog#v11" TextStyle="TextStyle.H2" TagName="TagName.H1" class="rz-pt-8">
Radzen Blazor Components v11 Changelog
</RadzenText>
<RadzenText TextStyle="TextStyle.Subtitle1" TagName="TagName.P" class="rz-pb-4">
Track and review changes to Radzen Blazor Components v11
</RadzenText>
<RadzenText Anchor="changelog#v11-radzenmarkdown" TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-pt-8">
RadzenMarkdown
</RadzenText>
<ul>
<li><RadzenBadge BadgeStyle="BadgeStyle.Danger" Shade="Shade.Lighter" Text="Breaking" /> The Markdown parser namespace has changed from <code>Radzen.Blazor.Markdown</code> to <code>Radzen.Documents.Markdown</code>. Update <code>using</code> directives accordingly.</li>
</ul>
<RadzenText Anchor="changelog#v10" TextStyle="TextStyle.H2" TagName="TagName.H1" class="rz-pt-8">
Radzen Blazor Components v10 Changelog
</RadzenText>