add markdown support for text widgets

This commit is contained in:
2023-03-19 20:10:04 +01:00
parent c7af333052
commit bacd86d836
7 changed files with 1386 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
<style>
mat-form-field textarea {
height: 7em;
height: 20em;
}
</style>
<h1 mat-dialog-title>Add Text</h1>
@@ -9,6 +9,7 @@
<mat-label>Text</mat-label>
<textarea matInput [(ngModel)]="text" #textElement focus></textarea>
</mat-form-field>
<div>Text field supports <a href="https://spec.commonmark.org/" target="_blank" rel="noopener">Markdown</a>.</div>
</div>
<div mat-dialog-actions align="end">
<button mat-button mat-dialog-close (click)="close()">Cancel</button>

View File

@@ -29,5 +29,5 @@
<button mat-icon-button (click)="edit()"><img src="/assets/img/edit-outline.svg"/></button>
<button mat-icon-button (click)="delete()"><img src="/assets/img/recycle-bin-line.svg"/></button>
</div>
<p *ngFor="let line of lines()">{{line}}</p>
<markdown [data]="this.data.text"></markdown>
</div>