Skip to content

Commit 5c4a1e1

Browse files
Copilotbrianrob
andauthored
Add markdown table formatting when copying stacks for GitHub issues (#2203)
* Initial plan for issue * Add leading and trailing | to table rows for markdown rendering Co-authored-by: brianrob <6210322+brianrob@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: brianrob <6210322+brianrob@users.noreply.github.com>
1 parent e9fa64a commit 5c4a1e1

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/PerfView/StackViewer/PerfDataGrid.xaml.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@ public PerfDataGrid()
6363
morphedContent = PadForColumn(morphedContent, i + e.StartColumnDisplayIndex);
6464
}
6565

66+
// Add a leading | character to the first column to ensure GitHub renders the content as table
67+
if (i == 0)
68+
{
69+
morphedContent = "| " + morphedContent;
70+
}
71+
72+
// Add a trailing | character to the last column to complete the markdown table row
73+
if (i == e.ClipboardRowContent.Count - 1)
74+
{
75+
morphedContent = morphedContent + " |";
76+
}
77+
6678
// TODO Ugly, morph two cells on different rows into one line for the correct cut/paste experience
6779
// for ranges.
6880
if (m_clipboardRangeEnd != m_clipboardRangeStart) // If we have just 2 things selected (and I can tell them apart)

0 commit comments

Comments
 (0)