Skip to content

Commit

Permalink
Allow webp image
Browse files Browse the repository at this point in the history
See #726 and markdown like link/image see #725
  • Loading branch information
danpros committed Apr 27, 2024
1 parent 8f5a3a3 commit c67b859
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions system/admin/editor/js/Markdown.Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1800,11 +1800,12 @@
// the first bracket could then not act as the "not a backslash" for the second.
chunk.selection = (" " + chunk.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g, "$1\\").substr(1);

var linkDef = " [999]: " + properlyEncoded(link);
// var linkDef = " [999]: " + properlyEncoded(link);

var num = that.addLinkDef(chunk, linkDef);
// var num = that.addLinkDef(chunk, linkDef);
chunk.startTag = isImage ? "![" : "[";
chunk.endTag = "][" + num + "]";
// chunk.endTag = "][" + num + "]";
chunk.endTag = "](" + properlyEncoded(link) + ")";

if (!chunk.selection) {
if (isImage) {
Expand Down
2 changes: 1 addition & 1 deletion upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
date_default_timezone_set('Asia/Jakarta');
}

$whitelist = array('jpg', 'jpeg', 'jfif', 'pjpeg', 'pjp', 'png', 'gif');
$whitelist = array('jpg', 'jpeg', 'jfif', 'pjpeg', 'pjp', 'png', 'gif', 'webp');
$name = null;
$dir = 'content/images/';
$error = null;
Expand Down

0 comments on commit c67b859

Please sign in to comment.