Merge remote-tracking branch 'origin/develop' into setttingssync
This commit is contained in:
commit
44ae68b025
22 changed files with 180 additions and 76 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { parseLinkHeader } from '@web3-storage/parse-link-header'
|
||||
import escapeHtml from 'escape-html'
|
||||
import fileTypeService from '../file_type/file_type.service.js'
|
||||
import punycode from 'punycode.js'
|
||||
|
||||
import { isStatusNotification } from '../notification_utils/notification_utils.js'
|
||||
|
|
@ -297,6 +298,11 @@ export const parseAttachment = (data) => {
|
|||
// output.meta = ??? missing
|
||||
}
|
||||
|
||||
if (data.type !== 'unknown') {
|
||||
output.type = data.type
|
||||
} else {
|
||||
output.type = fileTypeService.fileType(output.mimetype)
|
||||
}
|
||||
output.url = data.url
|
||||
output.large_thumb_url = data.preview_url
|
||||
output.description = data.description
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export const getAttrs = (tag, filter) => {
|
|||
.replace(/\/?$/, '')
|
||||
.trim()
|
||||
const attrs = Array.from(
|
||||
innertag.matchAll(/([a-z]+[a-z0-9-]*)(?:=("[^"]+?"|'[^']+?'))?/gi),
|
||||
innertag.matchAll(/([a-z]+[a-z0-9-]*)(?:=((?:"(?:\\.|[^"\\])*")|(?:'(?:\\.|[^'\\])*')))?/gi),
|
||||
)
|
||||
.map(([, key, value]) => [key, value])
|
||||
.map(([k, v]) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue