From bf5d28ea8d10c41b80a80c825526400aa3edfa15 Mon Sep 17 00:00:00 2001
From: Phil Hughes <me@iamphill.com>
Date: Tue, 5 Jul 2016 11:54:49 +0100
Subject: [PATCH] Fixed markdown buttons in FF

---
 app/assets/javascripts/lib/utils/text_utility.js.coffee | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/assets/javascripts/lib/utils/text_utility.js.coffee b/app/assets/javascripts/lib/utils/text_utility.js.coffee
index 7bcb876d056..2e1407f8738 100644
--- a/app/assets/javascripts/lib/utils/text_utility.js.coffee
+++ b/app/assets/javascripts/lib/utils/text_utility.js.coffee
@@ -49,8 +49,9 @@
       insertText = "#{startChar}#{tag}#{selected}#{if wrap then tag else ' '}"
 
     if document.queryCommandSupported('insertText')
-      document.execCommand 'insertText', false, insertText
-    else
+      inserted = document.execCommand 'insertText', false, insertText
+
+    unless inserted
       try
         document.execCommand("ms-beginUndoUnit")
 
-- 
GitLab