Unterscheide Eingang und Ausgang an der Einbindung und ermoegliche Umbenennen, Archivieren, Loeschen und Verschieben.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
20625b4596
commit
ad6240a5da
27 files changed
+1191
-88
No files matched your search
@@ -1,4 +1,4 @@
|
||||
"""Bounded note documents. Only paragraph text is stored."""
|
||||
"""Bounded note documents. Paragraphs or one Markdown block are stored."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -9,6 +9,11 @@ def clean_document(document: dict) -> dict:
|
||||
blocks = document.get("blocks")
|
||||
if not isinstance(blocks, list) or len(blocks) > 400:
|
||||
raise unprocessable("Die Notiz hat kein gültiges Dokument.")
|
||||
if len(blocks) == 1 and isinstance(blocks[0], dict) and blocks[0].get("type") == "markdown":
|
||||
text = blocks[0].get("text")
|
||||
if not isinstance(text, str) or len(text) > 100_000:
|
||||
raise unprocessable("Die Notiz enthält einen nicht unterstützten Block.")
|
||||
return {"version": 1, "blocks": [{"type": "markdown", "text": text}]}
|
||||
clean = []
|
||||
for block in blocks:
|
||||
if not isinstance(block, dict) or set(block) - {"type", "text"}:
|
||||
|
||||
Reference in new issue
Block a user