mirror of
https://github.com/dergigi/boris.git
synced 2026-02-23 07:54:59 +01:00
fix: resolve linting and TypeScript errors
- Remove unused faExpand import from ReadingDisplaySettings - Fix TypeScript type errors in VideoEmbedProcessor - Add explicit string[] type annotations for regex match results - All linting and type checking now passes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
import { faHighlighter, faUnderline, faNetworkWired, faUserGroup, faUser, faAlignLeft, faAlignJustify, faExpand } from '@fortawesome/free-solid-svg-icons'
|
||||
import { faHighlighter, faUnderline, faNetworkWired, faUserGroup, faUser, faAlignLeft, faAlignJustify } from '@fortawesome/free-solid-svg-icons'
|
||||
import { UserSettings } from '../../services/settingsService'
|
||||
import IconButton from '../IconButton'
|
||||
import ColorPicker from '../ColorPicker'
|
||||
|
||||
@@ -28,11 +28,11 @@ const VideoEmbedProcessor = forwardRef<HTMLDivElement, VideoEmbedProcessorProps>
|
||||
|
||||
// Find all video URLs in the HTML content
|
||||
const videoUrlPattern = /https?:\/\/[^\s<>"']+\.(mp4|webm|ogg|mov|avi|mkv|m4v)(?:\?[^\s<>"']*)?/gi
|
||||
const videoUrls = html.match(videoUrlPattern) || []
|
||||
const videoUrls: string[] = html.match(videoUrlPattern) || []
|
||||
|
||||
// Also check for video URLs that might not have extensions but are classified as video
|
||||
const allUrlPattern = /https?:\/\/[^\s<>"']+/gi
|
||||
const allUrls = html.match(allUrlPattern) || []
|
||||
const allUrls: string[] = html.match(allUrlPattern) || []
|
||||
const videoUrlsWithoutExt = allUrls.filter(url => {
|
||||
const classification = classifyUrl(url)
|
||||
return classification.type === 'video' && !videoUrls.includes(url)
|
||||
@@ -60,10 +60,10 @@ const VideoEmbedProcessor = forwardRef<HTMLDivElement, VideoEmbedProcessorProps>
|
||||
}
|
||||
|
||||
const videoUrlPattern = /https?:\/\/[^\s<>"']+\.(mp4|webm|ogg|mov|avi|mkv|m4v)(?:\?[^\s<>"']*)?/gi
|
||||
const videoUrls = html.match(videoUrlPattern) || []
|
||||
const videoUrls: string[] = html.match(videoUrlPattern) || []
|
||||
|
||||
const allUrlPattern = /https?:\/\/[^\s<>"']+/gi
|
||||
const allUrls = html.match(allUrlPattern) || []
|
||||
const allUrls: string[] = html.match(allUrlPattern) || []
|
||||
const videoUrlsWithoutExt = allUrls.filter(url => {
|
||||
const classification = classifyUrl(url)
|
||||
return classification.type === 'video' && !videoUrls.includes(url)
|
||||
|
||||
Reference in New Issue
Block a user