| Auto-Submit | +1 |
| Commit-Queue | +1 |
function escapeMarkdown(val: string): string {Jack FranklinI played a bit with this this function. I think that we should also escape HTML tags and other special characters like the `*` as it will otherwise be rendered incorrectly in Markdown.
Nicholas RoscinoRight, I guess your logic is if the console table contains the string `"**foo**"` then we don't want that to be bold, but the literal string? Maybe we should define a list of special chars and backslash before a bunch of them.
Jack FranklinYeah exactly. in my test I had bold, italic and also a cell containing an html tag and they were then rendered in the markdown result
Nicholas RoscinoNice, thanks for thinking about that! I can't believe it didn't cross my mind 😄 I will have a play with this and ping you again when I have a new patch.
Jack FranklinSure! No problem!
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
10 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: front_end/panels/console/ConsoleViewMessage.test.ts
Insertions: 1, Deletions: 1.
@@ -609,7 +609,7 @@
assert.exists(markdownItem);
contextMenu.invokeHandler(markdownItem.id());
- const expectedMarkdown = '| (index) | a |\n' +
+ const expectedMarkdown = '| \\(index\\) | a |\n' +
'| --- | --- |\n' +
'| 0 | 1 |';
sinon.assert.calledOnceWithExactly(copyTextStub, expectedMarkdown);
```
Console: Add support for copying tables as Markdown or CSV
Console tables printed via console.table() contain structured data
that is difficult to extract for external use.
To allow users to export this data, introduce context menu options to
copy table views as Markdown or CSV. This is implemented by:
- Creating a DataGridExporter utility containing standalone functions
exportToMarkdown and exportToCSV. This serializes the visual
DataGrid contents, extracting text from DOM nodes within cell values,
and applying standard escaping rules for Markdown and CSV syntax.
- Extending DataGridImpl to support custom table-wide context menus via
a new callback hook (setTableContextMenuCallback).
- Integrating this hook in ConsoleTableMessageView to present the copy
options and write the serialized table contents to the clipboard.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |