From 4c042b3c8275ba0c40de8057cad20f3936466373 Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 27 Aug 2025 18:09:27 +0000 Subject: [PATCH] catch markdown table-fmt error; closes #699 --- copyparty/web/md2.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/copyparty/web/md2.js b/copyparty/web/md2.js index 26b1e14b..a8229366 100644 --- a/copyparty/web/md2.js +++ b/copyparty/web/md2.js @@ -697,8 +697,14 @@ function reLastIndexOf(txt, ptn, end) { // table formatter function fmt_table(e) { if (e) e.preventDefault(); - //dom_tbox.className = ''; - + try { + fmt_table2(); + } + catch (ex) { + return toast.err(7, 'table-format (CTRL-K) failed:\n' + ex); + } +} +function fmt_table2() { var txt = dom_src.value, ofs = dom_src.selectionStart, //o0 = txt.lastIndexOf('\n\n', ofs),