Skip to content
This repository was archived by the owner on Aug 29, 2020. It is now read-only.

Commit 9ebe215

Browse files
committed
respect HR after code
1 parent f56d556 commit 9ebe215

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

Compiler/OctokitExtensions.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,32 @@ public static string ExtractSummary(this Issue issue)
6666
var builder = new StringBuilder();
6767
if (lines.Any(x => x.StartsWith("--")))
6868
{
69+
var previousIsCode = false;
6970
var previousIsEmpty = true;
71+
var inCode = false;
7072
foreach (var line in lines)
7173
{
72-
if (previousIsEmpty)
74+
if (line.StartsWith("```"))
75+
{
76+
previousIsCode = inCode;
77+
inCode = !inCode;
78+
}
79+
if (!inCode)
7380
{
74-
if (line == "--")
81+
if (previousIsEmpty || previousIsCode)
7582
{
76-
break;
83+
if (line == "--")
84+
{
85+
break;
86+
}
7787
}
7888
}
89+
90+
7991
builder.AppendLine(line);
8092

8193
previousIsEmpty = string.IsNullOrWhiteSpace(line);
94+
8295
}
8396
}
8497
else

0 commit comments

Comments
 (0)