git » sdk » commit 28c491d

Fix corrupted TypeScript signatures in generated docs

author Waqas Hussain
2026-09-19 17:19:25 UTC
committer GitHub
2026-09-19 17:19:25 UTC
parent 9a32bb6b8621053e99a96b61f1ec37eb69a46f99

Fix corrupted TypeScript signatures in generated docs

The docs build inserts markdown="1" into HTML tags so MkDocs can
render Markdown inside them. The replacement also matched TypeScript
generics, turning Array<borogove_Chat> into
Array<borogove markdown="1"_Chat>.

Skip fenced code blocks and require a tag-name boundary when adding
the attribute.

Verified against all 646 generated JavaScript documentation pages:
256 code blocks were corrected, with no changes outside code blocks
in Markdown or rendered HTML, excluding the build timestamp.

Makefile +1 -1

diff --git a/Makefile b/Makefile
index 618d22b..2ac91f3 100644
--- a/Makefile
+++ b/Makefile
@@ -150,7 +150,7 @@ doc:
 	npx @microsoft/api-extractor run -c npm/api-extractor.json || true
 	npx @microsoft/api-documenter markdown -i tmp -o docs/js/
 	rm -r tmp
-	find docs/js/ -name '*.md' -exec sed -i.bak 's/<\([[:alpha:]][[:alpha:]]*\)/<\1 markdown="1"/g' \{\} \;
+	find docs/js/ -name '*.md' -exec sed -i.bak '/^```/,/^```/!s/<\([[:alpha:]][[:alnum:]]*\)\([[:space:]>]\)/<\1 markdown="1"\2/g' \{\} \;
 	find docs/js/ -name '*.bak' -exec $(RM) {} \;
 	git checkout docs/js/index.md
 	mkdocs build