commit: e16d1fc847c1bddc96ef7e8849d025e98e770cdc
parent 6f92644ba8097aa4a1a117d78fcf9ab158776bb8
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sat, 2 Sep 2023 23:03:39 +0200
vanilla-editor: Add some more text
Diffstat:
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/vanilla-editor/vanilla-editor.js b/vanilla-editor/vanilla-editor.js
@@ -9,6 +9,15 @@ view.addEventListener("input", (event) => {
source.value = view.innerHTML;
});
-let hello = 'This is an example of <i>VanillaJS rich-text edition</i>. Your browser probably provides you with Word Processor shortcuts (ctrl-i for Italic, ctrl-b for Bold) in the rich-text editing mode.';
+// Abusing JS Templates for multiline
+let hello = `This is an example of VanillaJS rich-text edition. Your browser probably provides you with Word Processor shortcuts (ctrl-i for Italic, ctrl-b for Bold) in the rich-text editing mode. Meh parts are when it comes to things beyond just basic text-formatting like links, lists, tables, …
+<ol>
+<li>First item</li>
+<li>Second item</li>
+</ol>
+<p>Tables are where it’s usually not great at and where you’d definitely need some helper code for the user to add rows/columns:</p>
+<table>
+<tbody><tr><th>A</th><th>B</th><th>C</th></tr>
+<tr><td>1</td><td>2</td><td>3</td></tr></tbody></table>`;
view.innerHTML = hello;
source.value = hello;