[PR #6869] [MERGED] docs: fix AI chat code formatting issue #23836

Closed
opened 2026-04-15 22:00:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6869
Author: @bytaesu
Created: 12/18/2025
Status: Merged
Merged: 12/19/2025
Merged by: @himself65

Base: canaryHead: 2025-12-19/docs/improve-ai-chat


📝 Commits (8)

  • 4e94654 clean up tailwind classname
  • 928535c add reindent helper
  • d98f389 chore: add hast types dev deps
  • 3ad01d7 fix: lockfile
  • b4f05d8 Merge branch 'canary' into 2025-12-19/docs/improve-ai-chat
  • 277e574 chore: add type js-beautify dev deps
  • f4d8518 js-beautify first, fallback to reindent
  • 57d233d split Pre component

📊 Changes

4 files changed (+95 additions, -16 deletions)

View changed files

📝 docs/components/floating-ai-search.tsx (+4 -4)
📝 docs/components/markdown.tsx (+78 -10)
📝 docs/package.json (+2 -0)
📝 pnpm-lock.yaml (+11 -2)

📄 Description

After repeated testing, responses occasionally had incorrect indentation. To address this, I used the existing js-beautify first to format the code, and applied reindent as a fallback.

https://github.com/user-attachments/assets/0c31267e-cfdf-41e5-bc20-1b413b0609bc


Summary by cubic

Normalize indentation in AI chat code blocks to fix occasional misaligned formatting. Adds js-beautify for JS/TS/JSON, cleans up Tailwind classes, and adds missing types for the docs build.

  • Bug Fixes
    • Format JS/TS/JSON code blocks with js-beautify and fallback to a bracket-aware reindent for others, ensuring consistent indentation while ignoring strings and comments.

Written for commit 57d233dc04. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6869 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 12/18/2025 **Status:** ✅ Merged **Merged:** 12/19/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `2025-12-19/docs/improve-ai-chat` --- ### 📝 Commits (8) - [`4e94654`](https://github.com/better-auth/better-auth/commit/4e946543fc1c614979c6844e0778e4bbe3c96a52) clean up tailwind classname - [`928535c`](https://github.com/better-auth/better-auth/commit/928535c94bcf66e55e22062d33fdc6ae3a5c0266) add reindent helper - [`d98f389`](https://github.com/better-auth/better-auth/commit/d98f389061d540376885c7dd54685cb3851200ec) chore: add hast types dev deps - [`3ad01d7`](https://github.com/better-auth/better-auth/commit/3ad01d70546bf02ac418b415e7ba3a7250e376a7) fix: lockfile - [`b4f05d8`](https://github.com/better-auth/better-auth/commit/b4f05d870018da2ee11b705abe4acd65dab82ba9) Merge branch 'canary' into 2025-12-19/docs/improve-ai-chat - [`277e574`](https://github.com/better-auth/better-auth/commit/277e574a2964f362e7fefe76a8f98776db0856de) chore: add type js-beautify dev deps - [`f4d8518`](https://github.com/better-auth/better-auth/commit/f4d85181601e8ef97dadb62f2e76b6f8700dc0b0) js-beautify first, fallback to reindent - [`57d233d`](https://github.com/better-auth/better-auth/commit/57d233dc043c5d90d16a8708d8bbdb8a82037cf8) split Pre component ### 📊 Changes **4 files changed** (+95 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `docs/components/floating-ai-search.tsx` (+4 -4) 📝 `docs/components/markdown.tsx` (+78 -10) 📝 `docs/package.json` (+2 -0) 📝 `pnpm-lock.yaml` (+11 -2) </details> ### 📄 Description After repeated testing, responses occasionally had incorrect indentation. To address this, I used the existing `js-beautify` first to format the code, and applied `reindent` as a fallback. https://github.com/user-attachments/assets/0c31267e-cfdf-41e5-bc20-1b413b0609bc <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Normalize indentation in AI chat code blocks to fix occasional misaligned formatting. Adds js-beautify for JS/TS/JSON, cleans up Tailwind classes, and adds missing types for the docs build. - **Bug Fixes** - Format JS/TS/JSON code blocks with js-beautify and fallback to a bracket-aware reindent for others, ensuring consistent indentation while ignoring strings and comments. <sup>Written for commit 57d233dc043c5d90d16a8708d8bbdb8a82037cf8. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 22:00:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#23836