🐛 Fix #4
This commit is contained in:
parent
762f21ba78
commit
f10d522a79
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
.invalid-type {
|
.invalid-type {
|
||||||
color: red;
|
color: red;
|
||||||
margin: 5px;
|
font-size: 20px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background-color: lightpink;
|
background-color: lightpink;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import {TipsProvider} from "./tips-provider";
|
import {TipsProvider} from "./tips-provider";
|
||||||
import {ProviderList} from "./provider-list";
|
import {ProviderList} from "./provider-list";
|
||||||
|
import {RENDER_CLASS} from "../constant";
|
||||||
|
|
||||||
export declare interface Provider {
|
export declare interface Provider {
|
||||||
check: (type: string) => boolean
|
check: (type: string) => boolean
|
||||||
|
@ -17,7 +18,7 @@ export class ProviderFactory {
|
||||||
process(type: string, content: string, options: IOptions = {
|
process(type: string, content: string, options: IOptions = {
|
||||||
cdn: "."
|
cdn: "."
|
||||||
}) {
|
}) {
|
||||||
let html = "<h2 class='invalid-type'>Invalid Type!</h2>"
|
let html = `<div class='${RENDER_CLASS} invalid-type'>Invalid Type</div>`
|
||||||
this.providers.forEach(provider => {
|
this.providers.forEach(provider => {
|
||||||
if (provider.check(type)) {
|
if (provider.check(type)) {
|
||||||
html = provider.process(type, content, options)
|
html = provider.process(type, content, options)
|
||||||
|
|
Loading…
Reference in New Issue