https://github.com/warlock/cleanchar
Clean special chars
https://github.com/warlock/cleanchar
characters clean-language
Last synced: 5 days ago
JSON representation
Clean special chars
- Host: GitHub
- URL: https://github.com/warlock/cleanchar
- Owner: warlock
- License: mit
- Created: 2017-10-30T07:29:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-11T13:28:36.000Z (over 7 years ago)
- Last Synced: 2025-10-21T10:49:27.664Z (9 months ago)
- Topics: characters, clean-language
- Language: JavaScript
- Size: 16.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cleanchar
Clean special characters
[](https://badge.fury.io/js/cleanchar)
[](https://travis-ci.org/warlock/cleanchar)
#### Options:
If you need can use options: cleanchar(text, options)
```
social = Enable # and @
spanish = Enable ñ and ç
```
#### Example with options:
```js
const cleanchar = require('cleanchar')
const text = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam varius porttitor est a ornare. Quisque pulvinar nec libero ut posuere. Praesent lobortis eleifend magna, eu egestas lorem. Proin vitae diam leo. Nunc placerat nibh a tellus volutpat molestie.
¡¡¡Texto Español. Troç de text en català. Play with #hashtags and @social!!!
Nullam sodales, diam sit amet volutpat feugiat, lectus neque lacinia mauris, scelerisque vulputate diam nunc at mi. Vestibulum semper quam faucibus dolor fermentum suscipit.`
const cleantext = cleanchar(text, { social: true })
```
#### Return:
```
lorem ipsum dolor sit amet consectetur adipiscing elit aliquam varius porttitor est a ornare quisque pulvinar nec libero ut posuere praesent lobortis eleifend magna eu egestas lorem proin vitae diam leo nunc placerat nibh a tellus volutpat molestie texto espanol troc de text en catala play with #hashtags and @social nullam sodales diam sit amet volutpat feugiat lectus neque lacinia mauris scelerisque vulputate diam nunc at mi vestibulum semper quam faucibus dolor fermentum suscipit
```
## License
The MIT License (MIT)
Copyright (c) 2017 Josep Subils (js@js.gl)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR