diff --git a/CHANGELOG.md b/CHANGELOG.md index 9091f865..d4b61755 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * CHANGED: Refactored translation of exception messages * FIXED: Some exceptions not getting translated * FIXED: Attachment disappears after a "paste" in the message area (#1731) +* FIXED: The content format is not reset when creating a new document (#1707) ## 1.7.9 (2025-11-13) * CHANGED: Upgrading libraries to: base-x 5.0.1, bootstrap 5.3.8, DOMpurify 3.2.7, ip-lib 1.21.0 & kjua 0.10.0 diff --git a/js/privatebin.js b/js/privatebin.js index 08ab28e3..a8294775 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -4632,7 +4632,11 @@ jQuery.PrivateBin = (function($) { */ me.setFormat = function(format) { - $formatter.parent().find(`a[data-format="${format}"]`).click(); + if (Helper.isBootstrap5()) { + $formatter.find(`select`).val(format); + } else { + $formatter.parent().find(`a[data-format="${format}"]`).click(); + } } /** @@ -5792,6 +5796,10 @@ jQuery.PrivateBin = (function($) { AttachmentViewer.removeAttachment(); TopNav.resetInput(); + // reset format + PasteViewer.setFormat('plaintext'); + TopNav.setFormat('plaintext'); + TopNav.showCreateButtons(); // newPaste could be called when user is on document clone editing view diff --git a/lib/Configuration.php b/lib/Configuration.php index f94b8338..61f5a551 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -122,7 +122,7 @@ class Configuration 'js/kjua-0.10.0.js' => 'sha512-BYj4xggowR7QD150VLSTRlzH62YPfhpIM+b/1EUEr7RQpdWAGKulxWnOvjFx1FUlba4m6ihpNYuQab51H6XlYg==', 'js/legacy.js' => 'sha512-rGXYUpIqbFoHAgBXZ0UlJBdNAIMOC9EQ67MG0X46D5uRB8LvwzgKirbSQRGdYfk8I2jsUcm+tvHXYboUnC6DUg==', 'js/prettify.js' => 'sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==', - 'js/privatebin.js' => 'sha512-WyXqnKduXRN1dClbnznN/GoOAhjpEzmtc4d3xrgoaMlFR/7YtfJtMvGIoLbX8S2Bx5GMhvbGOocRa28INaewcQ==', + 'js/privatebin.js' => 'sha512-mU0j5BlLPSzNPlNDWtQP1oXiLLC4QqSOl1/zliMvoLsMbdWGECi6Vv0+VhidbXdxsweDdIsSU2OmigujtN2cYA==', 'js/purify-3.3.0.js' => 'sha512-lsHD5zxs4lu/NDzaaibe27Vd2t7Cy9JQ3qDHUvDfb4oZvKoWDNEhwUY+4bT3R68cGgpgCYp8U1x2ifeVxqurdQ==', 'js/showdown-2.1.0.js' => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==', 'js/zlib-1.3.1-1.js' => 'sha512-5bU9IIP4PgBrOKLZvGWJD4kgfQrkTz8Z3Iqeu058mbQzW3mCumOU6M3UVbVZU9rrVoVwaW4cZK8U8h5xjF88eQ==',