Skip to content

Commit c0244fb

Browse files
committed
enhance: keyword in subject should not contains " character
Signed-off-by: leo <longshuang@msn.cn>
1 parent 48d0412 commit c0244fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Views/CommitSubjectPresenter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,14 @@ private void GenerateInlineElements()
257257
else
258258
{
259259
var colonIdx = subject.IndexOf(": ", StringComparison.Ordinal);
260-
if (colonIdx > 0 && colonIdx < 32 && colonIdx < subject.Length - 3 && _elements.Intersect(0, colonIdx) == null)
260+
if (colonIdx > 0 && colonIdx < 32 && colonIdx < subject.Length - 3 && subject.IndexOf('"', 0, colonIdx) == -1 && _elements.Intersect(0, colonIdx) == null)
261261
{
262262
_elements.Add(new Models.InlineElement(Models.InlineElementType.Keyword, 0, colonIdx + 1, string.Empty));
263263
}
264264
else
265265
{
266266
var hyphenIdx = subject.IndexOf(" - ", StringComparison.Ordinal);
267-
if (hyphenIdx > 0 && hyphenIdx < 32 && hyphenIdx < subject.Length - 4 && _elements.Intersect(0, hyphenIdx) == null)
267+
if (hyphenIdx > 0 && hyphenIdx < 32 && hyphenIdx < subject.Length - 4 && subject.IndexOf('"', 0, hyphenIdx) == -1 && _elements.Intersect(0, hyphenIdx) == null)
268268
{
269269
_elements.Add(new Models.InlineElement(Models.InlineElementType.Keyword, 0, hyphenIdx, string.Empty));
270270
}

0 commit comments

Comments
 (0)