This commit is contained in:
Aevann1 2021-09-16 17:16:44 +02:00
parent b07ca4804c
commit be1b9a66a2
2 changed files with 20 additions and 13 deletions

View file

@ -369,7 +369,7 @@
/* src\App.svelte generated by Svelte v3.42.6 */
const file = "src\\App.svelte";
// (21:1) {:else}
// (27:1) {:else}
function create_else_block(ctx) {
let t;
@ -389,14 +389,14 @@
block,
id: create_else_block.name,
type: "else",
source: "(21:1) {:else}",
source: "(27:1) {:else}",
ctx
});
return block;
}
// (19:1) {#if show_preview}
// (25:1) {#if show_preview}
function create_if_block_1(ctx) {
let t;
@ -416,14 +416,14 @@
block,
id: create_if_block_1.name,
type: "if",
source: "(19:1) {#if show_preview}",
source: "(25:1) {#if show_preview}",
ctx
});
return block;
}
// (28:0) {#if show_preview}
// (34:0) {#if show_preview}
function create_if_block(ctx) {
let html_tag;
let raw_value = marked__default['default'](marking(/*text*/ ctx[0])) + "";
@ -452,7 +452,7 @@
block,
id: create_if_block.name,
type: "if",
source: "(28:0) {#if show_preview}",
source: "(34:0) {#if show_preview}",
ctx
});
@ -502,17 +502,17 @@
attr_dev(textarea, "oninput", "charLimit('post-text','character-count-submit-text-form');checkForRequired()");
attr_dev(textarea, "maxlength", "10000");
textarea.required = true;
add_location(textarea, file, 15, 0, 247);
add_location(textarea, file, 21, 0, 468);
attr_dev(div, "class", "btn btn-secondary");
set_style(div, "float", "right");
add_location(div, file, 17, 0, 567);
add_location(pre, file, 25, 0, 722);
add_location(div, file, 23, 0, 788);
add_location(pre, file, 31, 0, 943);
attr_dev(span, "class", "position-absolute text-small font-weight-bold");
attr_dev(span, "id", "character-count-submit-text-form");
set_style(span, "right", "1rem");
set_style(span, "bottom", "0.5rem");
set_style(span, "z-index", "3");
add_location(span, file, 31, 0, 792);
add_location(span, file, 37, 0, 1013);
},
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
@ -596,8 +596,15 @@
return block;
}
function marking(input) {
markdown = input.replace("sex", "fuck");
function marking(markdown) {
let emojis = Array.from(markdown.matchAll(/:(.{1,30}?):/gi));
if (emojis != null) {
for (i = 0; i < emojis.length; i++) {
markdown = markdown.replace(emojis[i][0], "<img height=30 src='/assets/images/emojis/" + emojis[i][1] + ".webp'>");
}
}
return markdown;
}

View file

@ -7,7 +7,7 @@
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous" type="37cef32129ec2b1bc32e9226-text/javascript"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script defer src='/assets/js/svelte.js'></script>
<script defer src='/assets/js/bundle.js'></script>
<script>