Skip to content
Snippets Groups Projects
Commit 08dab8e7 authored by Gabriel Engel's avatar Gabriel Engel
Browse files

Adding strike instruction

parent c9b056c0
No related branches found
No related tags found
No related merge requests found
...@@ -1689,7 +1689,7 @@ a.github-fork { ...@@ -1689,7 +1689,7 @@ a.github-fork {
} }
} }
> .users-typing { > .users-typing {
float: right; float: left;
height: 20px; height: 20px;
font-size: 12px; font-size: 12px;
color: #888; color: #888;
......
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
<footer class="footer"> <footer class="footer">
<form class="message-form" method="post" action="/"> <form class="message-form" method="post" action="/">
<div> <div>
<!--input type="text" class="input-message" value="" /-->
{{> messagePopupConfig getPupupConfig}} {{> messagePopupConfig getPupupConfig}}
<textarea name="msg" class="input-message"></textarea> <textarea name="msg" class="input-message"></textarea>
<i class="icon-paper-plane" title="{{_ "chatWindowDashboard.Send_Message"}}"></i> <i class="icon-paper-plane" title="{{_ "chatWindowDashboard.Send_Message"}}"></i>
...@@ -83,6 +82,7 @@ ...@@ -83,6 +82,7 @@
<div class="formatting-tips" aria-hidden="true"> <div class="formatting-tips" aria-hidden="true">
<b>*bold*</b> <b>*bold*</b>
<i>_italics_</i> <i>_italics_</i>
<strike>~strike~</strike>
<code class="inline">`inline code`</code> <code class="inline">`inline code`</code>
<code class="inline">```multi-line```</code> <code class="inline">```multi-line```</code>
<q>&gt;quote</q> <q>&gt;quote</q>
......
...@@ -6,15 +6,21 @@ ...@@ -6,15 +6,21 @@
class Markdown class Markdown
constructor: (message) -> constructor: (message) ->
msg = message.html or '' if _.trim message.html
# Process MD like for strong, italic and strike msg = message.html
msg = msg.replace(/(\ |^)\*([^*]+)\*(\ |$)/gm, '$1<strong>$2</strong>$3')
msg = msg.replace(/(\ |^)\_([^_]+)\_(\ |$)/gm, '$1<em>$2</em>$3') # Process MD like for strong, italic and strike
msg = msg.replace(/(\ |^)\`([^`]+)\`(\ |$)/gm, '$1<code class="inline">$2</code>$3') msg = msg.replace(/(\ |^)\*([^*]+)\*(\ |$)/gm, '$1<strong>$2</strong>$3')
msg = msg.replace(/(\ |^)\~{1,2}([^~]+)\~{1,2}(\ |$)/gm, '$1<strike>$2</strike>$3') msg = msg.replace(/(\ |^)\_([^_]+)\_(\ |$)/gm, '$1<em>$2</em>$3')
msg = msg.replace(/(\ |^)\`([^`]+)\`(\ |$)/gm, '$1<code class="inline">$2</code>$3')
msg = msg.replace(/(\ |^)\~{1,2}([^~]+)\~{1,2}(\ |$)/gm, '$1<strike>$2</strike>$3')
msg = msg.replace(/^&gt;(.*)$/gm, '<q>$1</q>')
message.html = msg
console.log 'Markdown', message if window.rocketDebug
message.html = msg
return message return message
RocketChat.callbacks.add 'renderMessage', Markdown, RocketChat.callbacks.priority.LOW RocketChat.callbacks.add 'renderMessage', Markdown, RocketChat.callbacks.priority.LOW
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment