An open API service indexing awesome lists of open source software.

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

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