fix: add URL-to-ID extraction, comment_mode validation, and pipe escaping

Address CodeRabbit review feedback:
- Extract doc ID from full Google Docs URLs (e.g. /d/<id>/)
- Validate comment_mode against allowed values
- Escape pipe characters in table cell text

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Max Ghenis
2026-02-18 19:26:31 -08:00
parent 08ad7ad308
commit 7b7fcfdb58
2 changed files with 12 additions and 1 deletions

View File

@@ -194,7 +194,8 @@ def _extract_cell_text(cell: dict[str, Any]) -> str:
text = _convert_paragraph_text(content_elem["paragraph"])
if text.strip():
parts.append(text.strip())
return " ".join(parts)
cell_text = " ".join(parts)
return cell_text.replace("|", "\\|")
def format_comments_inline(markdown: str, comments: list[dict[str, Any]]) -> str: