diff --git a/src/utils/editor.js b/src/utils/editor.js index 2a43ac04c..bce920475 100644 --- a/src/utils/editor.js +++ b/src/utils/editor.js @@ -132,7 +132,7 @@ export const makeJsonMetadataForUpdate = (oldJson, meta, tags) => { export const extractMetadata = (body) => { const urlReg = /(\b(https?|ftp):\/\/[A-Z0-9+&@#/%?=~_|!:,.;-]*[-A-Z0-9+&@#/%=~_|])/gim; const userReg = /(^|\s)(@[a-z][-.a-z\d]+[a-z\d])/gim; - const imgReg = /(https?:\/\/.*\.(?:png|jpg|jpeg|gif|heic))/gim; + const imgReg = /(https?:\/\/.*\.(?:png|jpg|jpeg|gif|heic|webp))/gim; const out = {}; diff --git a/src/utils/image.js b/src/utils/image.js index cd206190d..ee742071f 100644 --- a/src/utils/image.js +++ b/src/utils/image.js @@ -64,7 +64,7 @@ export const catchEntryImage = (entry, width = 0, height = 0, format = 'match') }; export const catchDraftImage = (body, format = 'match', thumbnail = false) => { - const imgRegex = /(https?:\/\/.*\.(?:png|jpg|jpeg|gif|heic))/gim; + const imgRegex = /(https?:\/\/.*\.(?:png|jpg|jpeg|gif|heic|webp))/gim; format = whatOs === 'android' ? 'webp' : 'match'; if (body && imgRegex.test(body)) {