feat(web): SSR nav brand/client embed and form markdown labels
Replace author theme.js with framework chrome (nav brand, theme boot, client mount) plus bridge scroll/observe helpers; add form submit copy and type=markdown textareas so sites can drop business JS. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
aeac4d6d20
commit
98018fc63b
19 files changed
+777
-84
No files matched your search
@@ -0,0 +1,27 @@
|
||||
package render
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestFormatMetaDate(t *testing.T) {
|
||||
if got := formatMetaDate("2026-09-17T13:41:04Z"); got != "2026-09-17" {
|
||||
t.Fatalf("got %q", got)
|
||||
}
|
||||
if got := formatMetaDate("plain"); got != "plain" {
|
||||
t.Fatalf("got %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTuneDropcapHTML(t *testing.T) {
|
||||
in := "<p>中文首段。</p><p>二段</p>"
|
||||
out := tuneDropcapHTML(in)
|
||||
if !strings.Contains(out, `class="has-dropcap"`) {
|
||||
t.Fatalf("expected dropcap: %s", out)
|
||||
}
|
||||
skip := "<p>$E=mc^2$</p>"
|
||||
if got := tuneDropcapHTML(skip); strings.Contains(got, "has-dropcap") {
|
||||
t.Fatalf("formula should skip: %s", got)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user