Skip to content

Commit

Permalink
version 0.16.0: also makes hyperlinks out of FGHI URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mithgol committed Nov 18, 2014
1 parent e5a5571 commit 82396fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fidohtml.js
Expand Up @@ -431,7 +431,7 @@ var FidoHTML = function(options){
/* jshint -W101 */
if( typeof sourceCode !== 'string' ) return sourceCode;
return sourceCode.split(
/(\b(?:https?|ftp|mailto|bitcoin|dchub|ed2k|facetime|feed|geo|irc(?:6|s)?|magnet|mms|news|nntp|sips?|skype|sms|ssh|tel|telnet|tftp|xmpp):[^\s<>\x22\x27{}\^\[\]`]+)/
/(\b(?:https?|ftp|mailto|bitcoin|dchub|ed2k|facetime|feed|geo|irc(?:6|s)?|magnet|mms|news|nntp|sips?|skype|sms|ssh|tel|telnet|tftp|xmpp|netmail|areafix|echomail|area|faqserv|fecho|freq):[^\s<>\x22\x27{}\^\[\]`]+)/
).map(function(sourceFragment, fragmentIndex){
if( fragmentIndex % 2 === 0 ){ // simple fragment's index: 0, 2...
return sourceFragment;
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "fidohtml",
"main": "fidohtml.js",
"version": "0.15.0",
"version": "0.16.0",
"description": "Makes HTML code out of a Fidonet message.",
"keywords": ["Fidonet", "Fido", "HTML"],
"author": { "name": "Mithgol the Webmaster" },
Expand Down
7 changes: 7 additions & 0 deletions test/test.js
Expand Up @@ -60,6 +60,13 @@ describe('URL processor', function(){
'foo [<a href="skype:echo123">skype:echo123</a>] bar'
);
});
it('area:// URL in angle brackets is processed', function(){
assert.deepEqual(
FidoHTML.fromText('foo <area://Ru.Blog.Mithgol> bar'),
'foo &lt;<a href="area://Ru.Blog.Mithgol">' +
'area://Ru.Blog.Mithgol</a>&gt; bar'
);
});
it('dataMode works fine', function(){
assert.deepEqual(
inDataMode.fromText('mailto:someone@example.com'),
Expand Down

0 comments on commit 82396fd

Please sign in to comment.