Make it compatible with stable branch

Make it compatible with stable branch

diff --git a/assets/javascripts/initializers/spoiler-alert.js.es6 b/assets/javascripts/initializers/spoiler-alert.js.es6
index 06ae47e..9e9596d 100644
--- a/assets/javascripts/initializers/spoiler-alert.js.es6
+++ b/assets/javascripts/initializers/spoiler-alert.js.es6
@@ -30,43 +30,45 @@ function initializeSpoiler(api) {
     }
   });
 
-  Tag.prototype.decorate = function(text) {
-    const attr = this.element.attributes;
-    if (attr.class === "spoiled") {
-      this.prefix = "[spoiler]";
-      this.suffix = "[/spoiler]";
-    }
-
-    if (this.prefix || this.suffix) {
-      text = [this.prefix, text, this.suffix].join("");
-    }
-
-    if (this.inline) {
-      text = " " + text + " ";
-    }
+  if (Tag) {
+    Tag.prototype.decorate = function(text) {
+      const attr = this.element.attributes;
+      if (attr.class === "spoiled") {
+        this.prefix = "[spoiler]";
+        this.suffix = "[/spoiler]";
+      }
 
-    return text;
-  };
+      if (this.prefix || this.suffix) {
+        text = [this.prefix, text, this.suffix].join("");
+      }
 
-  Tag.block = function(name, prefix, suffix) {
-    return class extends Tag {
-      constructor() {
-        super(name, prefix, suffix);
-        this.gap = "\n\n";
+      if (this.inline) {
+        text = " " + text + " ";
       }
 
-      decorate(text) {
-        const attr = this.element.attributes;
-        if (this.name === "div" && attr.class === "spoiled") {
-          this.prefix = "[spoiler]";
-          this.suffix = "[/spoiler]";
-          text = text.trim();
+      return text;
+    };
+
+    Tag.block = function(name, prefix, suffix) {
+      return class extends Tag {
+        constructor() {
+          super(name, prefix, suffix);
+          this.gap = "\n\n";
         }
 
-        return `${this.gap}${this.prefix}${text}${this.suffix}${this.gap}`;
-      }
+        decorate(text) {
+          const attr = this.element.attributes;
+          if (this.name === "div" && attr.class === "spoiled") {
+            this.prefix = "[spoiler]";
+            this.suffix = "[/spoiler]";
+            text = text.trim();
+          }
+
+          return `${this.gap}${this.prefix}${text}${this.suffix}${this.gap}`;
+        }
+      };
     };
-  };
+  }
 }
 
 export default {

GitHub
sha: 434fad80