'use strict';varreplaceEntities=require('../common/utils').replaceEntities;module.exports=functionnormalizeLink(url){varnormalized=replaceEntities(url);// We shouldn't care about the result of malformed URIs,// and should not throw an exception.try{normalized=decodeURI(normalized);}catch(err){}returnencodeURI(normalized);};