forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLineBreakRenderer.cs
More file actions
31 lines (29 loc) · 874 Bytes
/
Copy pathLineBreakRenderer.cs
File metadata and controls
31 lines (29 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.IO;
using Markdig;
using Markdig.Renderers;
using Markdig.Syntax.Inlines;
namespace Microsoft.PowerShell.MarkdownRender
{
/// <summary>
/// Renderer for adding VT100 escape sequences for line breaks.
/// </summary>
internal class LineBreakRenderer : VT100ObjectRenderer<LineBreakInline>
{
protected override void Write(VT100Renderer renderer, LineBreakInline obj)
{
// If it is a hard line break add new line at the end.
// Else, add a space for after the last character to improve readability.
if (obj.IsHard)
{
renderer.WriteLine();
}
else
{
renderer.Write(" ");
}
}
}
}