https://github.com/kosso/tihtml
Encode/decode HTML special characters and entities and more
https://github.com/kosso/tihtml
Last synced: 9 months ago
JSON representation
Encode/decode HTML special characters and entities and more
- Host: GitHub
- URL: https://github.com/kosso/tihtml
- Owner: kosso
- License: other
- Created: 2016-07-30T12:48:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-30T16:32:29.000Z (over 9 years ago)
- Last Synced: 2025-03-01T10:41:25.592Z (10 months ago)
- Language: Objective-C
- Homepage:
- Size: 237 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.txt
- License: LICENSE
Awesome Lists containing this project
README
# TiHTML
Encode/decode HTML special characters and entities and more...
Implementation of https://github.com/mwaterfall/MWFeedParser/blob/master/Classes/NSString%2BHTML.m as an Appcelerator Titanium iOS module.
```
var tihtml = require('com.kosso.tihtml');
console.log('MODULE: '+ tihtml);
/*
// Provides:
tihtml.convertHTMLToPlainText(string)
tihtml.stringByDecodingHTMLEntities(string)
tihtml.stringByEncodingHTMLEntities(string)
tihtml.stringByEncodingHTMLEntitiesUnicode(string)
tihtml.stringWithNewLinesAsBRs(string)
tihtml.stringByRemovingNewLinesAndWhitespace(string)
returns string
*/
var decoded = tihtml.stringByDecodingHTMLEntities('COOL & THE GANG Á < a acute');
console.log(decoded);
var encoded = tihtml.stringByEncodingHTMLEntities('warm > cool & les gangs
double quote " double quote - single : \' Æ ô ');
console.log(encoded);
```
See `example/app.js`
-----
@kosso