From a139120113f54336b3f636fba40ae518be92bf2f Mon Sep 17 00:00:00 2001 From: Gabriel Engel Date: Wed, 10 Jun 2015 11:24:51 -0300 Subject: [PATCH 01/20] fixed markdown regex and added `code` --- packages/rocketchat-markdown/markdown.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/rocketchat-markdown/markdown.coffee b/packages/rocketchat-markdown/markdown.coffee index 36b81f55d42ea..5dc3e4cca39d9 100644 --- a/packages/rocketchat-markdown/markdown.coffee +++ b/packages/rocketchat-markdown/markdown.coffee @@ -9,9 +9,10 @@ class Markdown msg = message.html or '' # Process MD like for strong, italic and strike - msg = msg.replace(/\*([^*]+)\*/g, '$1') - msg = msg.replace(/\_([^_]+)\_/g, '$1') - msg = msg.replace(/\~{1,2}([^~]+)\~{1,2}/g, '$1') + msg = msg.replace(/(\ |^)\*([^*]+)\*(\ |$)/gm, '$1$2$3') + msg = msg.replace(/(\ |^)\_([^_]+)\_(\ |$)/gm, '$1$2$3') + msg = msg.replace(/(\ |^)\`([^`]+)\`(\ |$)/gm, '$1$2$3') + msg = msg.replace(/(\ |^)\~{1,2}([^~]+)\~{1,2}(\ |$)/gm, '$1$2$3') message.html = msg return message From e41a59d81f0bad176fa7d147e7378e7619930d7c Mon Sep 17 00:00:00 2001 From: Gabriel Engel Date: Wed, 10 Jun 2015 11:47:05 -0300 Subject: [PATCH 02/20] added style for inline code --- client/stylesheets/base.less | 8 +++++++- packages/rocketchat-markdown/markdown.coffee | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/client/stylesheets/base.less b/client/stylesheets/base.less index d938abeca1c05..ca375fd3be33f 100644 --- a/client/stylesheets/base.less +++ b/client/stylesheets/base.less @@ -41,7 +41,7 @@ a { code { background: #f8f8f8; - border-radius: 6px; + border-radius: 4px; border: 1px solid #ccc; color: #333; display: block; @@ -49,6 +49,12 @@ code { overflow-x: auto; padding: 0.5em; word-wrap: break-word; + &.inline { + display: inline-block; + padding: 0 10px; + margin: 0; + vertical-align: bottom; + } } .text-center { diff --git a/packages/rocketchat-markdown/markdown.coffee b/packages/rocketchat-markdown/markdown.coffee index 5dc3e4cca39d9..adb1f6f723dc6 100644 --- a/packages/rocketchat-markdown/markdown.coffee +++ b/packages/rocketchat-markdown/markdown.coffee @@ -11,7 +11,7 @@ class Markdown # Process MD like for strong, italic and strike msg = msg.replace(/(\ |^)\*([^*]+)\*(\ |$)/gm, '$1$2$3') msg = msg.replace(/(\ |^)\_([^_]+)\_(\ |$)/gm, '$1$2$3') - msg = msg.replace(/(\ |^)\`([^`]+)\`(\ |$)/gm, '$1$2$3') + msg = msg.replace(/(\ |^)\`([^`]+)\`(\ |$)/gm, '$1$2$3') msg = msg.replace(/(\ |^)\~{1,2}([^~]+)\~{1,2}(\ |$)/gm, '$1$2$3') message.html = msg From c9b056c0bf1511171a2ef5cf8def7a4130108849 Mon Sep 17 00:00:00 2001 From: Gabriel Engel Date: Wed, 10 Jun 2015 14:02:10 -0300 Subject: [PATCH 03/20] formatting tips --- client/stylesheets/base.less | 12 +++++++++++- client/views/app/chatWindowDashboard.html | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/client/stylesheets/base.less b/client/stylesheets/base.less index ca375fd3be33f..2b1eb747f7e06 100644 --- a/client/stylesheets/base.less +++ b/client/stylesheets/base.less @@ -1628,7 +1628,7 @@ a.github-fork { } .footer { position: absolute; - padding: 14px 20px 0px 20px; + padding: 8px 20px 0px 20px; background: #fff; border-top: 1px solid @tertiary-background-color; z-index: 100; @@ -1689,11 +1689,21 @@ a.github-fork { } } > .users-typing { + float: right; height: 20px; font-size: 12px; color: #888; padding: 3px 0px 0px 5px; } + > .formatting-tips { + float: right; + height: 20px; + font-size: 12px; + color: #888; + padding: 3px 0px 0px 5px; + display: inline-block; + white-space: nowrap; + } } .add-user-search { height: 100%; diff --git a/client/views/app/chatWindowDashboard.html b/client/views/app/chatWindowDashboard.html index cb09d101e9df7..e5e35e912fdf6 100644 --- a/client/views/app/chatWindowDashboard.html +++ b/client/views/app/chatWindowDashboard.html @@ -80,6 +80,13 @@

{{/if}} {{/with}} + From 08dab8e72000b1560562277acc53fb808fbda84d Mon Sep 17 00:00:00 2001 From: Gabriel Engel Date: Wed, 10 Jun 2015 16:13:49 -0300 Subject: [PATCH 04/20] Adding strike instruction --- client/stylesheets/base.less | 2 +- client/views/app/chatWindowDashboard.html | 2 +- packages/rocketchat-markdown/markdown.coffee | 20 +++++++++++++------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/client/stylesheets/base.less b/client/stylesheets/base.less index 2b1eb747f7e06..867ad9570584f 100644 --- a/client/stylesheets/base.less +++ b/client/stylesheets/base.less @@ -1689,7 +1689,7 @@ a.github-fork { } } > .users-typing { - float: right; + float: left; height: 20px; font-size: 12px; color: #888; diff --git a/client/views/app/chatWindowDashboard.html b/client/views/app/chatWindowDashboard.html index e5e35e912fdf6..f18df6d420b6f 100644 --- a/client/views/app/chatWindowDashboard.html +++ b/client/views/app/chatWindowDashboard.html @@ -57,7 +57,6 @@