1.0.0 • Published 11 years ago
htmlification v1.0.0
#htmlification
Convert plain/text into html.
##features
- convert line breaking character (
\r\n) intobr. - convert schema uri (
any://th.in/g) into clickableatag. - convert schema less uri into clickable http
atag.
##Installation install via npm
npm install htmlification ##examples
var toHTML = require('htmlification');
var str = 'Foo http://foo.example.com' +
'\r\n' +
'Bar magnet://bar.example.com' +
'\r\n' +
'Baz baz://baz.example.com' +
'\r\n' +
'qux quz.example.com';
var result = toHTML(str);
console.log(result);result would be
Foo <a href="http://foo.example.com" target="blank">http://foo.example.com</a>
<br>
Bar <a href="magnet://bar.example.com" target="blank">magnet://bar.example.com</a>
<br>
Baz <a href="baz://baz.example.com" target="blank">baz://baz.example.com</a>
<br>
qux<a href="http://quz.example.com" target="blank">quz.example.com</a>##License MIT
1.0.0
11 years ago