Ver Fonte

:rotating_light:

Van há 6 anos atrás
pai
commit
854381ba0b

+ 1 - 1
src/index.ts

@@ -96,7 +96,7 @@ class Vditor {
                 this.vditor.hint = hint;
             }
             const hotkey = new Hotkey(this.vditor);
-        })
+        });
     }
 
     public getValue() {

+ 5 - 3
src/ts/markdown/mediaRender.ts

@@ -31,18 +31,20 @@ const iframeRender = (element: HTMLElement, url: string) => {
         element.remove();
     } else if (coubMatch && coubMatch[1]) {
         element.insertAdjacentHTML("afterend",
-            `<iframe src="//coub.com/embed/${coubMatch[1]}?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>`);
+            `<iframe
+ src="//coub.com/embed/${coubMatch[1]}?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>`);
         element.remove();
     } else if (facebookMatch && facebookMatch[0]) {
         element.insertAdjacentHTML("afterend",
-            `<iframe src="https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(facebookMatch[0])}"></iframe>`);
+            `<iframe
+src="https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(facebookMatch[0])}"></iframe>`);
         element.remove();
     } else if (dailymotionMatch && dailymotionMatch[2]) {
         element.insertAdjacentHTML("afterend",
             `<iframe src="https://www.dailymotion.com/embed/video/${dailymotionMatch[2]}"></iframe>`);
         element.remove();
     }
-}
+};
 
 export const mediaRender = (element: HTMLElement) => {
     element.querySelectorAll("a").forEach((aElement) => {

+ 4 - 3
src/ts/toolbar/Format.ts

@@ -1,15 +1,16 @@
 import formatSVG from "../../assets/icons/format.svg";
-import {MenuItem} from "./MenuItem";
-import {getText} from "../editor/getText";
 import {formatRender} from "../editor/formatRender";
 import {getSelectPosition} from "../editor/getSelectPosition";
+import {getText} from "../editor/getText";
+import {MenuItem} from "./MenuItem";
 
 export class Format extends MenuItem {
     constructor(vditor: IVditor, menuItem: IMenuItem) {
         super(vditor, menuItem);
         this.element.children[0].innerHTML = menuItem.icon || formatSVG;
         this.element.children[0].addEventListener("click", () => {
-            formatRender(vditor, lute.format(getText(vditor.editor.element)), getSelectPosition(vditor.editor.element, vditor.editor.range))
+            formatRender(vditor, lute.format(getText(vditor.editor.element)),
+                getSelectPosition(vditor.editor.element, vditor.editor.range));
         });
     }
 }

+ 1 - 1
src/ts/toolbar/index.ts

@@ -6,6 +6,7 @@ import {Code} from "./Code";
 import {Custom} from "./Custom";
 import {Divider} from "./Divider";
 import {Emoji} from "./Emoji";
+import {Format} from "./Format";
 import {Fullscreen} from "./Fullscreen";
 import {Headings} from "./Headings";
 import {Help} from "./Help";
@@ -24,7 +25,6 @@ import {Strike} from "./Strike";
 import {Table} from "./Table";
 import {Undo} from "./Undo";
 import {Upload} from "./Upload";
-import {Format} from "./Format";
 
 export class Toolbar {
     public elements: { [key: string]: HTMLElement };

+ 1 - 1
src/ts/types/index.d.ts

@@ -28,7 +28,7 @@ interface ITurndownRule {
 declare const lute: {
     markdown(text: string): string
     getEmojis(path: string): { [key: string]: string }
-    format(text:string):string
+    format(text: string): string,
 };
 
 declare var webkitAudioContext: {