SSWConsulting / SSWConsulting/SSW.Rules
🦙 Bug - TinaCMS Dependency - Code block inside Box MDX component breaks page formatting
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 26
- Forks
- 17
- Avg merge
- 14h 39m
- Merged PRs (30d)
- 2
Description
Requested by: @suiyangqiu via YakShaver.ai 🦬
cc: @edkranz, @suiyangqiu, @Marxoz, @PothieuG, @Freego1783
Hi Team!
🟥 Watch the video (1 min 31 sec)
Url from screen share: https://ssw.com.au/rules/admin/index.html#/rules/mcp-servers-for-context
Pain
When editing Rules (Content) using the visual editor, placing a code block inside a custom MDX Box component causes the entire page formatting to break after saving and refreshing. The issue occurs because the code snippet contains curly braces, which prematurely terminate the Box MDX component and are not properly escaped by the visual editor.
Acceptance Criteria
- Code blocks can be safely added inside a Box MDX component without breaking page formatting.
- Curly braces within code blocks are correctly escaped when nested inside custom MDX components.
- Saving and refreshing the page preserves the expected layout and formatting.
- The visual editor correctly serializes and renders MDX with nested Box and code block components.
- No regression occurs for existing content that uses Box components or standalone code blocks.
Reproduce Steps
- Open a page in Rules (Content) using the visual editor.
- Add a code snippet inside a standard code block and verify formatting is correct.
- Add a Box MDX component to the page.
- Insert the same code snippet (containing curly braces) inside a code block within the Box component.
- Save the page and refresh the browser.
- Observe that the page formatting is broken after refresh.
Screenshot

Figure: Code block inside custom box breaks page formatting
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure in the Rules visual editor with a code block containing curly braces nested in a Box MDX component. Trace the TinaCMS serialization and rendering path for that nested content, then verify that saving and refreshing preserves the layout and that existing Box and standalone code blocks still render correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nextjs, typescript
- Domain
- content, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100