From 91ad103165042bbf27619793d5c2c7d0e9e00a19 Mon Sep 17 00:00:00 2001 From: Mithgol the Webmaster Date: Tue, 9 Sep 2014 21:00:15 +0400 Subject: [PATCH] =?UTF-8?q?convert=20Fidonet=C2=A0Unicode=C2=A0substrings?= =?UTF-8?q?=20(but=C2=A0not=20in=C2=A0UUE=C2=A0blocks)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fidohtml.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fidohtml.js b/fidohtml.js index 0cad74f..d17e39e 100644 --- a/fidohtml.js +++ b/fidohtml.js @@ -1,6 +1,7 @@ var ASTree = require('astree'); var Dauria = require('dauria'); var extend = require('extend'); +var Fiunis = require('fiunis'); var MIME = require('mime'); var UUE = require('uue'); var _s = require('underscore.string'); @@ -127,6 +128,14 @@ var FidoHTML = function(options){ } }); + // convert Fidonet Unicode substrings (but not in UUE blocks) + this.ASTree.defineSplitter(function(sourceWithFiunis){ + if( typeof sourceWithFiunis !== 'string' ) return sourceWithFiunis; + return Fiunis.decode(sourceWithFiunis); + }, [ + { type: 'origin', props: ['preParens', 'addrText'] } + ]); + // convert URLs to hyperlinks this.ASTree.defineSplitter(function(sourceCode){ /* jshint -W101 */