-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from humanspeak/0.7.-
Bugs: Fixing and updated test cases for tables
- Loading branch information
Showing
20 changed files
with
1,342 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ on: | |
paths-ignore: | ||
- '.github/**' | ||
- 'docs/**' | ||
- 'PRD.md' | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,5 @@ | |
"editor.formatOnPaste": true, | ||
"files.exclude": { | ||
"**/node_modules": true, | ||
"**/*.test.ts": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,227 @@ | ||
# Svelte Markdown Package | ||
|
||
## Overview | ||
|
||
@humanspeak/svelte-markdown is a powerful, customizable markdown renderer for Svelte with TypeScript support. It's built as a successor to the original svelte-markdown package by Pablo Berganza, now maintained and enhanced by Humanspeak, Inc. | ||
|
||
## Lineage | ||
|
||
1. Original Creator: Pablo Berganza (2020-2024) | ||
2. Current Maintainer: Humanspeak, Inc. (2024-present) | ||
|
||
## Core Features | ||
|
||
### 1. Markdown Rendering | ||
|
||
- Full markdown syntax support through Marked | ||
- Custom component overrides | ||
- HTML parsing capabilities via HTMLParser2 | ||
- GitHub-style slug generation for headers | ||
|
||
### 2. TypeScript Support | ||
|
||
- Full TypeScript definitions | ||
- Type-safe component props | ||
- Svelte 5 compatibility | ||
|
||
### 3. Testing Infrastructure | ||
|
||
- Comprehensive unit testing with Vitest | ||
- Coverage reporting via Coveralls | ||
- Browser environment testing with JSDOM | ||
|
||
## Technical Specifications | ||
|
||
### Dependencies | ||
|
||
- Core Dependencies: | ||
|
||
- marked: ^15.0.5 | ||
- github-slugger: ^2.0.0 | ||
- htmlparser2: ^10.0.0 | ||
|
||
- Peer Dependencies: | ||
- svelte: ^5.0.0 | ||
|
||
### Build Configuration | ||
|
||
- Vite-based build system | ||
- SvelteKit package preparation | ||
- Source map generation | ||
- TypeScript compilation | ||
|
||
### Package Structure | ||
|
||
- Distribution via NPM | ||
- ESM module format | ||
- Side effects declared for CSS files | ||
- Source maps included | ||
|
||
### Testing Setup | ||
|
||
- Vitest configuration with extensive edge case coverage | ||
- JSDOM environment for DOM manipulation testing | ||
- Testing Library integration for component testing | ||
- Coverage reporting with minimum 90% threshold | ||
- Specialized test suites for: | ||
- Malformed markdown input | ||
- Unicode and special character handling | ||
- Nested component scenarios | ||
- Memory leak prevention | ||
- Large document performance | ||
- Concurrent rendering scenarios | ||
|
||
### Edge Case Handling | ||
|
||
- Input Validation | ||
|
||
- Empty markdown strings | ||
- Non-string inputs | ||
- Malformed HTML within markdown | ||
- Deep nested lists (>10 levels) | ||
- Extended Unicode characters | ||
- Zero-width spaces and invisible characters | ||
|
||
- Component Behavior | ||
|
||
- Recursive component rendering | ||
- Circular reference detection | ||
- Dynamic component loading | ||
- Error boundary implementation | ||
- Memory management for large documents | ||
|
||
- Performance Considerations | ||
- Chunked rendering for large documents | ||
- Lazy loading for complex syntax | ||
- Resource cleanup on unmount | ||
- Debounced updates for live editing | ||
|
||
## Quality Assurance | ||
|
||
### Automated Testing | ||
|
||
- Unit tests for core functionality | ||
- Browser environment testing | ||
- Continuous Integration via GitHub Actions | ||
|
||
### Code Quality | ||
|
||
- ESLint for code quality | ||
- Prettier for code formatting | ||
- TypeScript for type safety | ||
|
||
## Distribution | ||
|
||
### Package Configuration | ||
|
||
- Scoped under @humanspeak | ||
- Type definitions included | ||
- ESM format | ||
- Svelte component exports | ||
|
||
### NPM Publishing | ||
|
||
- Public package under @humanspeak scope | ||
- Automated versioning and releases | ||
- Source maps included for debugging | ||
|
||
## License | ||
|
||
MIT License with dual copyright: | ||
|
||
- Copyright (c) 2024-2025 Humanspeak, Inc. | ||
- Copyright (c) 2020-2024 Pablo Berganza | ||
|
||
## Development Workflow | ||
|
||
### Build Process | ||
|
||
1. Development: npm run dev | ||
2. Testing: npm run test | ||
3. Building: npm run build | ||
4. Publishing: Automated via GitHub Actions | ||
|
||
### Contribution Guidelines | ||
|
||
- Pull requests welcome | ||
- Tests required for new features | ||
- Automated CI/CD pipeline | ||
- Code formatting enforced via Prettier | ||
|
||
## Future Roadmap | ||
|
||
### Planned Features | ||
|
||
1. Enhanced HTML parsing capabilities | ||
2. Additional markdown extensions | ||
3. Performance optimizations | ||
4. Extended component customization options | ||
|
||
### Maintenance Goals | ||
|
||
1. Regular dependency updates via Dependabot | ||
2. Continuous security monitoring | ||
3. Documentation improvements | ||
4. Community engagement | ||
|
||
## Support | ||
|
||
### Official Channels | ||
|
||
- GitHub Issues | ||
- NPM Package Page | ||
- Documentation Website | ||
|
||
### Commercial Support | ||
|
||
Available through Humanspeak, Inc. for enterprise customers | ||
|
||
## Migration Guide | ||
|
||
### From Svelte 4 | ||
|
||
- Update to Svelte 5 | ||
- Review component bindings | ||
- Check custom component implementations | ||
- Verify TypeScript types | ||
|
||
### From Other Markdown Libraries | ||
|
||
- Review component structure | ||
- Adapt custom renderers | ||
- Update event handlers | ||
- Migrate styling approaches | ||
|
||
## Implementation Priorities | ||
|
||
### Phase 1: Foundation (Completed) | ||
|
||
- Core markdown rendering with edge case handling | ||
- Robust syntax highlighting with fallback modes | ||
- Comprehensive component override system | ||
- Full TypeScript support with strict type checking | ||
- Edge case test suite implementation | ||
- Performance baseline measurements | ||
|
||
### Phase 2: Advanced Features (In Progress) | ||
|
||
- Math and diagram support with error handling | ||
- Interactive elements with accessibility support | ||
- Performance optimizations for large documents | ||
- Plugin system foundation with validation | ||
- Extended edge case coverage | ||
- Load testing infrastructure | ||
|
||
### Phase 3: Enterprise Features | ||
|
||
- Collaboration features | ||
- Security enhancements | ||
- Accessibility compliance | ||
- Advanced tooling | ||
|
||
### Phase 4: Ecosystem | ||
|
||
- Extended plugin library | ||
- Developer tools | ||
- Performance monitoring | ||
- Community features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.