all repos — NoPaste @ 83abec6015edce47355ec0b122af3bea37ec0ee8

Resurrected - The PussTheCat.org fork of NoPaste

Handle long content better
Boris Kubiak kubiakboris@gmail.com
Mon, 27 Apr 2020 19:08:35 +0200
commit

83abec6015edce47355ec0b122af3bea37ec0ee8

parent

e45e81ab97c3d7d096a3c0d4b985f387bfa5d28e

1 files changed, 3 insertions(+), 1 deletions(-)

jump to
M index.jsindex.js

@@ -128,7 +128,9 @@ };

// Build a shareable URL const buildUrl = (rawData, mode) => { - const url = `${location.protocol}//${location.host}/` + rawData + `?lang=${encodeURIComponent(select.selected())}`; + const base = `${location.protocol}//${location.host}/`; + const query = `?lang=${encodeURIComponent(select.selected())}`; + const url = rawData.length <= 4000 ? base + rawData + query : base + query + '#' + rawData; if (mode === 'markdown') { return `[NoPaste snippet](${url})`; }