Compare commits

..

No commits in common. "5170d3adf4a89816c4b8c845beec56e5a3b4dfb2" and "d08466ec700ebe4d9e3cbf4a73aa500f19829cf8" have entirely different histories.

4 changed files with 10 additions and 54 deletions

View File

@ -1,9 +0,0 @@
# Core SDK
Go module `git.dev.alexdunmow.com/block/core`. Defines plugin interfaces, template engine, block registry, and shared types for the BlockNinja CMS.
## Critical Rules
- **NEVER use `replace` directives in go.mod** — not in this repo, not in any consumer. All module resolution goes through the Gitea module proxy. If you need to test local changes, tag and push a version.
- Plugins import from core only — never from the CMS (`blockninja/backend`) or orchestrator.
- All consumers are in-house — no backwards compatibility shims needed. Just change the API and update consumers.

View File

@ -1 +0,0 @@
AGENTS.md

9
CLAUDE.md Normal file
View File

@ -0,0 +1,9 @@
# Core SDK
Go module `git.dev.alexdunmow.com/block/core`. Defines plugin interfaces, template engine, block registry, and shared types for the BlockNinja CMS.
## Critical Rules
- **NEVER use `replace` directives in go.mod** — not in this repo, not in any consumer. All module resolution goes through the Gitea module proxy. If you need to test local changes, tag and push a version.
- Plugins import from core only — never from the CMS (`blockninja/backend`) or orchestrator.
- All consumers are in-house — no backwards compatibility shims needed. Just change the API and update consumers.

View File

@ -374,17 +374,8 @@ func renderBlock(ctx context.Context, block map[string]any) string {
cellTag = "th"
cellClass = "px-4 py-3 text-left text-sm font-semibold"
}
// BlockNote >=0.15 wraps each cell as a tableCell object
// {type:"tableCell", content:[...]}; older docs store the
// cell's inline content (string or array) directly.
cellContent := cell
if cellMap, ok := cell.(map[string]any); ok {
if t, _ := cellMap["type"].(string); t == "tableCell" {
cellContent = cellMap["content"]
}
}
fmt.Fprintf(&sb, "<%s class=\"%s\">", cellTag, cellClass)
sb.WriteString(renderInlineContent(inlineContentFromRaw(cellContent), false))
sb.WriteString(renderInlineContent(inlineContentFromRaw(cell), false))
fmt.Fprintf(&sb, "</%s>", cellTag)
}
}

View File

@ -520,40 +520,6 @@ func TestTableCellStringContent(t *testing.T) {
}
}
// BlockNote >=0.15 (the editor ships 0.47) stores each table cell as a
// tableCell object: {type:"tableCell", props:{...}, content:[...inline]}.
// The renderer must unwrap content[] from these objects, not just bare
// inline arrays/strings.
func TestTableCellObjectContent(t *testing.T) {
cell := func(text string) map[string]any {
return map[string]any{
"type": "tableCell",
"props": map[string]any{},
"content": []any{map[string]any{"type": "text", "text": text}},
}
}
doc := map[string]any{
"blocks": []any{
map[string]any{
"type": "table",
"content": map[string]any{
"type": "tableContent",
"rows": []any{
map[string]any{"cells": []any{cell("Header A"), cell("Header B")}},
map[string]any{"cells": []any{cell("Cell A"), cell("Cell B")}},
},
},
},
},
}
html := BlockNoteToHTML(context.Background(), doc)
for _, want := range []string{"Header A", "Header B", "Cell A", "Cell B"} {
if !strings.Contains(html, want) {
t.Errorf("expected table cell content %q in output: %s", want, html)
}
}
}
func TestNestedListRendering(t *testing.T) {
doc := map[string]any{
"blocks": []any{