diff --git a/public/css/site.css b/public/css/site.css index 72ba943..2427198 100644 --- a/public/css/site.css +++ b/public/css/site.css @@ -17,4 +17,9 @@ .log p { color: #666; -} \ No newline at end of file +} +.log span.cmd { + background: #eee; + color: #003e80; + padding: 3px 8px; +} diff --git a/public/js/app.js b/public/js/app.js index 8eef6bb..faca366 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -25,10 +25,12 @@ url = function(string){ } var titleRegex = /^(.*\n)/; title = function(string){ - var str=''+string.replace(titleRegex, '$1'); return ''+string.replace(titleRegex, '$1'); } - +var cmdRegex = /```([^`]*?)```/g +cmd = function(string) { + return ''+string.replace(cmdRegex, '$1'); +} function updatePage(data){ var content = ""; @@ -47,7 +49,7 @@ function updatePage(data){

${escape(item.created_at)} -- ${escape(item.author)} -- ${escape(item.server)}

-
 ${title(url(escape(item.content)))}
+
 ${cmd(title(url(escape(item.content))))}
`;