You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
703 B
33 lines
703 B
<script lang="ts">
|
|
import type { EmbeddedFile } from "../main";
|
|
import sanLink from "linkify-string";
|
|
|
|
export let files: EmbeddedFile[];
|
|
|
|
let contents = files.map((e) => (e.data as Buffer).toString());
|
|
|
|
const san = (s: string) =>
|
|
sanLink(s)
|
|
.split("\n")
|
|
.map((m) =>
|
|
m.trim().startsWith('>')
|
|
? `<span style="color: #b5bd68">${m.trim()}</span>`
|
|
: m.trim())
|
|
.join("\n");
|
|
</script>
|
|
|
|
{#each contents as content}
|
|
<div class="additionnal">
|
|
{@html san(content)}
|
|
</div>
|
|
{/each}
|
|
|
|
<style scoped>
|
|
.additionnal {
|
|
border-top: 2px dashed;
|
|
clear: both;
|
|
margin-top: 10px;
|
|
padding-top: 10px;
|
|
white-space: pre-wrap;
|
|
}
|
|
</style>
|
|
|