Skip to content

Commit

Permalink
Use null-coalescing assignment operator
Browse files Browse the repository at this point in the history
  • Loading branch information
iamcarbon committed Dec 15, 2023
1 parent 35aa304 commit a377239
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
8 changes: 3 additions & 5 deletions src/Markdig/Extensions/Footnotes/FootnoteParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private BlockState TryOpen(BlockProcessor processor, bool isContinue)

// Advance the column
int deltaColumn = processor.Start - start;
processor.Column = processor.Column + deltaColumn;
processor.Column += deltaColumn;

processor.NextChar(); // Skip ':'

Expand Down Expand Up @@ -170,10 +170,8 @@ private void Document_ProcessInlinesEnd(InlineProcessor state, Inline? inline)
paragraphBlock = new ParagraphBlock();
footnote.Add(paragraphBlock);
}
if (paragraphBlock.Inline == null)
{
paragraphBlock.Inline = new ContainerInline();
}

paragraphBlock.Inline ??= new ContainerInline();

foreach (var link in footnote.Links)
{
Expand Down
5 changes: 1 addition & 4 deletions src/Markdig/Extensions/Tables/GridTableParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,7 @@ private BlockState HandleContents(BlockProcessor processor, GridTableState table
ColumnIndex = i
};

if (columnSlice.BlockProcessor is null)
{
columnSlice.BlockProcessor = processor.CreateChild();
}
columnSlice.BlockProcessor ??= processor.CreateChild();

// Ensure that the BlockParser is aware that the TableCell is the top-level container
columnSlice.BlockProcessor.Open(columnSlice.CurrentCell);
Expand Down

0 comments on commit a377239

Please sign in to comment.