-
Notifications
You must be signed in to change notification settings - Fork 0
Escape pipe characters and newlines in markdown table cells #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: MaestroError <46760939+MaestroError@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Property values containing newline characters (\n or \r) will break the markdown table formatting. Multi-line values should be escaped (e.g., replaced with paces) or truncated to maintain a valid markdown table structure. For example, if a rich_text or other property value contains line breaks, it will create invalid markdown table rows |
Co-authored-by: MaestroError <46760939+MaestroError@users.noreply.github.com>
I've implemented newline character handling in commit 13b9251. The solution replaces all newline variants ( Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Property names and values containing pipe characters (
|) or newline characters (\n,\r,\r\n) break markdown table formatting. For example, a property named "A | B" or containing "value | text" corrupts the table structure, and multi-line values create invalid markdown table rows.Changes
escapeTableCellCharacters()helper: Replaces|with\|and newline characters with spaces in table cell contentconvertPropertiesToMarkdownTable(): Escapes both property names and values before insertion\n,\r,\r\n, multiple newlines, and combinations with pipes (9 tests)Examples
Pipe characters - Before:
| Name | Title | Test | Page | <!-- Broken table structure -->Pipe characters - After:
Newlines - Before:
| Description | Line 1 Line 2 | <!-- Broken table structure -->Newlines - After:
| Description | Line 1 Line 2 | <!-- Newlines replaced with spaces -->✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.