Add <img> to Gefest's primitives
This commit is contained in:
parent
5f551af2b3
commit
150bb7a0a9
13
frontend/src/modules/Gefest/primitives/img.ts
Normal file
13
frontend/src/modules/Gefest/primitives/img.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { GefestElement } from "../element";
|
||||||
|
|
||||||
|
export class GefestImg extends GefestElement {
|
||||||
|
constructor(content : (GefestElement | string)[] | string, src: string) {
|
||||||
|
super(content);
|
||||||
|
this.setAttribute('src', src);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected wrapHTML (content: string): string {
|
||||||
|
const attrString = this.attributesToString();
|
||||||
|
return `<img ${attrString}>${content}</img>`;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user