import * as Markdown from "./markdown" ; export function translate ( md ) { md = newline ( md ) ; md = linkFILE ( md ) ; md = Markdown . render ( md ) ; return md ; } function newline ( md ) { return md . replace ( /\n/g , "<br>" ) ; } function linkFILE ( md ) { const urlRegex = /(file:\/\/[^\s]+)/g ; return md . replace ( urlRegex , ( url ) => { return ( '<div id="file"><a id="explorer" href="explorer:' + url + '">&#8678; </a>' + '<a href="' + url + '">' + url . replace ( "file://" , "" ) + "</a></div>" ) ; } ) ; }