Skip to content

Commit

Permalink
Fix TrackTrivia /// comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaZupan committed Mar 13, 2022
1 parent 6f75b51 commit b7d02ca
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/Markdig/Roundtrip.md
Expand Up @@ -111,14 +111,14 @@ All trivia in a document should be attached to a node. The `Block` class defines
/// <summary>
/// Gets or sets the trivia right before this block.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
public StringSlice TriviaBefore { get; set; }

/// <summary>
/// Gets or sets trivia occurring after this block.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
public StringSlice TriviaAfter { get; set; }
```
Expand Down
4 changes: 2 additions & 2 deletions src/Markdig/Syntax/IBlock.cs
Expand Up @@ -61,13 +61,13 @@ public interface IBlock : IMarkdownObject
/// <summary>
/// Trivia occurring before this block
/// </summary>
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise <see cref="StringSlice.IsEmpty"/>.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise <see cref="StringSlice.Empty"/>.
StringSlice TriviaBefore { get; set; }

/// <summary>
/// Trivia occurring after this block
/// </summary>
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise <see cref="StringSlice.IsEmpty"/>.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise <see cref="StringSlice.Empty"/>.
StringSlice TriviaAfter { get; set; }
}
}
17 changes: 8 additions & 9 deletions src/Markdig/Syntax/IFencedBlock.cs
Expand Up @@ -3,7 +3,6 @@
// See the license.txt file in the project root for more information.

using Markdig.Helpers;
using Markdig.Parsers;

namespace Markdig.Syntax
{
Expand All @@ -25,7 +24,7 @@ public interface IFencedBlock : IBlock
/// <summary>
/// Gets or sets the trivia after the <see cref="FencedChar"/>.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
StringSlice TriviaAfterFencedChar { get; set; }

Expand All @@ -38,14 +37,14 @@ public interface IFencedBlock : IBlock
/// <summary>
/// Non-escaped <see cref="Info"/> exactly as in source markdown.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
StringSlice UnescapedInfo { get; set; }

/// <summary>
/// Gets or sets the trivia after the <see cref="Info"/>.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
StringSlice TriviaAfterInfo { get; set; }

Expand All @@ -58,28 +57,28 @@ public interface IFencedBlock : IBlock
/// <summary>
/// Non-escaped <see cref="Arguments"/> exactly as in source markdown.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
StringSlice UnescapedArguments { get; set; }

/// <summary>
/// Gets or sets the trivia after the <see cref="Arguments"/>.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
StringSlice TriviaAfterArguments { get; set; }

/// <summary>
/// Newline of the line with the opening fenced chars.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="NewLine.None"/>.
/// </summary>
NewLine InfoNewLine { get; set; }

/// <summary>
/// Trivia before the closing fenced chars
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
StringSlice TriviaBeforeClosingFence { get; set; }

Expand All @@ -92,7 +91,7 @@ public interface IFencedBlock : IBlock
/// Newline after the last line, which is always the line containing the closing fence chars.
/// "Inherited" from <see cref="Block.NewLine"/>.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="NewLine.None"/>.
/// </summary>
NewLine NewLine { get; set; }
}
Expand Down
12 changes: 6 additions & 6 deletions src/Markdig/Syntax/Inlines/LinkInline.cs
Expand Up @@ -67,7 +67,7 @@ public LinkInline(string url, string title)
/// <summary>
/// Gets or sets the <see cref="Label"/> with trivia.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
public StringSlice LabelWithTrivia { get => _trivia?.LabelWithTrivia ?? StringSlice.Empty; set => Trivia.LabelWithTrivia = value; }

Expand Down Expand Up @@ -98,7 +98,7 @@ public LinkInline(string url, string title)
/// <summary>
/// Gets or sets the trivia before the <see cref="Url"/>.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
public StringSlice TriviaBeforeUrl { get => _trivia?.TriviaBeforeUrl ?? StringSlice.Empty; set => Trivia.TriviaBeforeUrl = value; }

Expand All @@ -123,14 +123,14 @@ public LinkInline(string url, string title)
/// <summary>
/// The <see cref="Url"/> but with trivia and unescaped characters
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
public StringSlice UnescapedUrl { get => _trivia?.UnescapedUrl ?? StringSlice.Empty; set => Trivia.UnescapedUrl = value; }

/// <summary>
/// Any trivia after the <see cref="Url"/>.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
public StringSlice TriviaAfterUrl { get => _trivia?.TriviaAfterUrl ?? StringSlice.Empty; set => Trivia.TriviaAfterUrl = value; }

Expand Down Expand Up @@ -160,14 +160,14 @@ public LinkInline(string url, string title)
/// Gets or sets the <see cref="Title"/> exactly as parsed from the
/// source document including unescaped characters
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
public StringSlice UnescapedTitle { get => _trivia?.UnescapedTitle ?? StringSlice.Empty; set => Trivia.UnescapedTitle = value; }

/// <summary>
/// Gets or sets the trivia after the <see cref="Title"/>.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
public StringSlice TriviaAfterTitle { get => _trivia?.TriviaAfterTitle ?? StringSlice.Empty; set => Trivia.TriviaAfterTitle = value; }

Expand Down
10 changes: 5 additions & 5 deletions src/Markdig/Syntax/LinkReferenceDefinition.cs
Expand Up @@ -63,14 +63,14 @@ public LinkReferenceDefinition(string? label, string? url, string? title) : this
/// <summary>
/// Non-normalized Label (includes trivia)
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
public StringSlice LabelWithTrivia { get => _trivia?.LabelWithTrivia ?? StringSlice.Empty; set => Trivia.LabelWithTrivia = value; }

/// <summary>
/// Whitespace before the <see cref="Url"/>.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
public StringSlice TriviaBeforeUrl { get => _trivia?.TriviaBeforeUrl ?? StringSlice.Empty; set => Trivia.TriviaBeforeUrl = value; }

Expand All @@ -87,7 +87,7 @@ public LinkReferenceDefinition(string? label, string? url, string? title) : this
/// <summary>
/// Non-normalized <see cref="Url"/>.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
public StringSlice UnescapedUrl { get => _trivia?.UnescapedUrl ?? StringSlice.Empty; set => Trivia.UnescapedUrl = value; }

Expand All @@ -101,7 +101,7 @@ public LinkReferenceDefinition(string? label, string? url, string? title) : this
/// <summary>
/// gets or sets the whitespace before a <see cref="Title"/>.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
public StringSlice TriviaBeforeTitle { get => _trivia?.TriviaBeforeTitle ?? StringSlice.Empty; set => Trivia.TriviaBeforeTitle = value; }

Expand All @@ -118,7 +118,7 @@ public LinkReferenceDefinition(string? label, string? url, string? title) : this
/// <summary>
/// Non-normalized <see cref="Title"/>.
/// Trivia: only parsed when <see cref="MarkdownPipeline.TrackTrivia"/> is enabled, otherwise
/// <see cref="StringSlice.IsEmpty"/>.
/// <see cref="StringSlice.Empty"/>.
/// </summary>
public StringSlice UnescapedTitle { get => _trivia?.UnescapedTitle ?? StringSlice.Empty; set => Trivia.UnescapedTitle = value; }

Expand Down

0 comments on commit b7d02ca

Please sign in to comment.