https://github.com/dnafication/llm-textfix
Sanitize LLM output by detecting and replacing 25+ problematic characters
https://github.com/dnafication/llm-textfix
ai character-cleaner llm react text-processing typescript unicode web-app
Last synced: about 1 month ago
JSON representation
Sanitize LLM output by detecting and replacing 25+ problematic characters
- Host: GitHub
- URL: https://github.com/dnafication/llm-textfix
- Owner: dnafication
- Created: 2025-06-30T04:43:05.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-30T05:03:51.000Z (12 months ago)
- Last Synced: 2025-06-30T05:31:57.706Z (12 months ago)
- Topics: ai, character-cleaner, llm, react, text-processing, typescript, unicode, web-app
- Language: TypeScript
- Homepage: https://llm-textfix.vercel.app/
- Size: 0 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LLM TextFix
**Sanitize LLM output by detecting and replacing 25+ problematic characters**
A modern web application that helps developers and content creators clean up text generated by Large Language Models (LLMs) by detecting and replacing problematic Unicode characters that can break workflows, cause formatting issues, or create copy-paste headaches.
## โจ Features
- **๐ Smart Detection**: Automatically highlights 25+ types of problematic characters
- **๐จ Visual Highlighting**: Color-coded highlighting by character category
- **โก One-Click Replacement**: Convert all problematic characters to standard equivalents
- **๐ Copy to Clipboard**: Easy copying of cleaned text
- **๐ฑ Mobile Responsive**: Works seamlessly on all screen sizes
- **๐ Fast & Lightweight**: Built with React and Vite for optimal performance
- **๐ก๏ธ Safe HTML Handling**: Prevents XSS by properly escaping HTML content
## ๐ฏ Supported Character Types
### Smart Quotes (๐ก Amber)
- Left/Right double quotation marks (" ")
- Left/Right single quotation marks (' ')
- Low quotation marks (โ โ)
- Angle quotation marks (ยซ ยป โน โบ)
### Dashes & Hyphens (๐ฃ Purple)
- Em dash (โ) โ Standard hyphen (-)
- En dash (โ) โ Standard hyphen (-)
- Various Unicode hyphens (โ โ โ โ)
### Invisible Spaces (๐ด Red)
- Non-breaking space
- Thin space, Hair space
- En space, Em space
- Narrow no-break space
- Line/Paragraph separators
- Ideographic space
### Special Punctuation (๐ข Green)
- Horizontal ellipsis (โฆ) โ Three dots (...)
## ๐ Getting Started
### Prerequisites
- Node.js 18+
- npm or yarn
### Installation
1. **Install dependencies**
```bash
npm install
```
2. **Start development server**
```bash
npm run dev
```
3. **Open in browser**
Navigate to `http://localhost:5173`
### Building for Production
```bash
npm run build
npm run preview
```
## ๐ฎ Usage
1. **Input Text**: Paste your LLM-generated text into the textarea
2. **View Highlights**: Problematic characters are automatically highlighted with tooltips
3. **Replace Characters**: Click "Replace" to convert all problematic characters
4. **Copy Result**: Use "Copy" to copy the cleaned text to your clipboard
## ๐ ๏ธ Tech Stack
- **Frontend**: React, TypeScript
- **Styling**: Tailwind CSS
- **Build Tool**: Vite
- **Development**: ESLint, PostCSS, Autoprefixer
## ๐ค Contributing
Contributions are welcome! Here are some ways you can help:
1. **Add new character types**: Expand the `PROBLEMATIC_CHARS` object
2. **Improve mobile experience**: Enhance responsive design
3. **Add features**: Implement new functionality like regex patterns
4. **Fix bugs**: Report and fix issues
5. **Improve documentation**: Enhance README or add code comments
### Development Workflow
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Make your changes
4. Commit your changes (`git commit -m 'Add amazing feature'`)
5. Push to the branch (`git push origin feature/amazing-feature`)
6. Open a Pull Request
## ๐ Common Issues
### Characters not highlighting?
- Ensure the character is included in the `PROBLEMATIC_CHARS` object in `App.tsx`
- Check if the character category has proper CSS styling
### Tailwind styles not working?
- Verify `postcss.config.js` exists
- Check that Tailwind directives are in `src/index.css`
- Restart the development server
## ๐ Acknowledgments
- Inspired by the common copy-paste issues with LLM output
---
Made with โค๏ธ for developers dealing with LLM output formatting issues.