Special Characters & Edge Cases
This guide covers how EmberDocs handles special characters and unusual document structures.
Filename Handling
Valid Filenames
EmberDocs supports filenames with:
β kebab-case: my-document.md
β numbers: guide-123.md
β underscores: my_document.md
β numbers-and-hyphens: api-v2-docs.mdSpecial Characters to Avoid
| Character | Issue | Workaround |
|---|---|---|
@ | URL encoding issues | Use hyphen instead: @api β api |
# | Fragment identifier | Use word: api#response β api-response |
% | Percent encoding | Avoid entirely |
! | Shell special char | Use word: important! β important |
& | URL parsing | Use word: html&css β html-css |
| Space | URL encoding | Use hyphen: my doc β my-doc |
Recommended Naming Convention
Use lowercase with hyphens (kebab-case):
β good: advanced-features.md
β good: api-reference.md
β good: getting-started-guide.md
β bad: AdvancedFeatures.md
β bad: api_reference.md
β bad: Getting Started Guide.mdSlug Structure
The slug field in frontmatter defines the document URL:
---
title: "Advanced Features"
slug: "guides/advanced-features" # becomes /docs/guides/advanced-features
---Slug Generation
The generateSlug() function creates URL-safe slugs from text:
// Examples
generateSlug('Getting Started'); // "getting-started"
generateSlug('API & Reference'); // "api-and-reference"
generateSlug('Hello World!'); // "hello-world"
generateSlug('Special-Chars_123'); // "special-chars123"Behavior:
- Converts to lowercase
- Replaces
&withand - Removes special characters (keeps alphanumeric, spaces, hyphens)
- Replaces spaces with hyphens
- Trims leading/trailing hyphens
Note: Frontmatter slug fields are used as-is in URLs. For heading IDs, generateSlug() is used automatically.
Content Edge Cases
Unicode & International Characters
Markdown content (not filenames) supports full Unicode:
# δ½ ε₯½ (Hello in Chinese)
This document uses Γ©mojis: π π β¨
### ΓoΓ±o (Spanish special chars)All render correctly with proper charset=utf-8 in HTML head.
Code Block Edge Cases
Empty Code Blocks
Empty blocks render correctly with no errors.
Unspecified Language
This is a code block without a language identifier.
It renders in default monospace styling.Unknown Language
This uses an unsupported language.
It falls back to plain text rendering.Very Long Lines
const veryLongFunctionNameThatGoesOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOn = () => {};Horizontal scroll handles this gracefully.
Heading Edge Cases
Special Characters in Headings
# API Documentation (v2.0)
## Using @decorators
### Functions & MethodsAll render correctly and are included in table of contents.
Very Long Headings
The TOC and page handle this without breaking.
Link Edge Cases
Absolute vs Relative Links
[Absolute](/docs/guides/basic-usage)
[Relative](../guides/basic-usage)
[External](https://example.com)
[With Fragment](/docs/api-reference/configuration#environment-setup)All link types work correctly in navigation context.
Broken Links
If a linked document doesn't exist:
- Development mode: Shows warning in console
- Production: Link renders but targets 404 page
Metadata Edge Cases
Missing Fields
Missing optional fields don't break the document:
---
title: "Minimal Document"
slug: "minimal"
---Optional fields (author, date, tags, order) default to sensible values.
Invalid Date Format
---
title: "Document"
slug: "doc"
date: "not a date" # Invalid
---Invalid dates are skipped; frontmatter still parses correctly.
Large Documents
EmberDocs handles large documents:
| Metric | Limit | Status |
|---|---|---|
| File size | No hard limit | β Tested to 1MB+ |
| Headings | No limit | β TOC can be long |
| Words | No limit | β Tested to 50k+ words |
| Code blocks | No limit | β Many tested |
Performance remains good even with very large documents.
Many Tags
---
tags: [
"documentation",
"guides",
"api",
"reference",
"tutorial",
"advanced",
"intermediate",
"beginner",
"examples"
]
---Tag arrays of any size work correctly.
Table Edge Cases
Simple Table
| Left | Right |
|---|---|
| A | B |
Wide Table
| Column 1 | Column 2 | Column 3 | Column 4 | Column 5 |
|---|---|---|---|---|
| Data 1 | Data 2 | Data 3 | Data 4 | Data 5 |
Horizontal scroll handles overflow.
Table with Special Characters
| Symbol | Name | Unicode |
|---|---|---|
| β | Check | U+2713 |
| β | Arrow | U+2192 |
| β | Suit | U+2660 |
All render correctly.
List Edge Cases
Deeply Nested Lists
- Level 1
- Level 2
- Level 3
- Level 4
- Level 5
- Level 6
- Level 5
- Level 4
- Level 3
- Level 2
Nesting to any depth works without breaking.
Mixed List Types
- Ordered item
- Unordered sub-item
- Another unordered
- Next ordered
- Sub-item
- Final ordered
Mixed nesting renders correctly.
Large Lists
EmberDocs handles lists with:
- 10s of items
- 100s of items
- 1000s of items (though very long lists should be paginated for UX)
HTML in Markdown
Raw HTML in markdown:
<div class="custom">
<p>This HTML is preserved</p>
</div>HTML is rendered as-is in the content.
Script Tags
Script tags in markdown are handled by react-markdown, which renders them as text by default. For security, you should not include script tags in markdown content.
Note: react-markdown does not execute scripts, but they may render as visible text. Avoid including script tags in documentation content.
Performance Edge Cases
Many Documents
EmberDocs is designed to handle:
- 100+ documents efficiently
- 1000+ documents with good performance
- Larger document sets (performance may vary based on content size)
Large Search Index
Search index size depends on document count and content:
- Index is pre-built at build time
- Stored as JSON in
public/search-index.json - FlexSearch index is built client-side from the serialized documents
- No runtime build penalty (index is loaded once on page load)
Image Handling
Images in markdown are rendered as standard <img> tags:

Note: For optimal performance, optimize images before including them in documentation. Large images may impact page load times.
Troubleshooting Edge Cases
Document Not Found
Symptom: 404 when visiting document Check:
- Slug matches file path
- File uses
.mdextension - Frontmatter is valid YAML
# Valid structure
file: docs/examples/guides/basic-usage.md
slug: "guides/basic-usage"
url: /docs/guides/basic-usageCharacter Encoding Issues
Symptom: Special characters display as ? or corrupted
Check:
- File saved as UTF-8
- HTML head includes:
<meta charset="utf-8"> - No BOM (Byte Order Mark) in file
TOC Not Updating
Symptom: Table of contents doesn't highlight active section Check:
- Headings have
idattributes (auto-added) - JavaScript enabled in browser
- IntersectionObserver supported
Best Practices Summary
- Filenames: Use lowercase with hyphens
- Slugs: Match file path, keep simple
- Content: Use standard Markdown
- Tables: Keep reasonable width
- Images: Optimize before including
- Lists: Nest to 5 levels max
- Code: Use proper language tags
- Links: Use absolute paths in docs
See Also: