Merge pull request #1993 from ecency/nt/webp-support

Nt Webp
This commit is contained in:
Feruz M 2021-07-12 23:03:09 +03:00 committed by GitHub
commit 550a5f3e1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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 = {};

View File

@ -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)) {