mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #4240 from overleaf/ns-trim-urls
Trim outer whitespace when adding file from external URL GitOrigin-RevId: b85b1aac81a138d7ebc11b36f180468cdf778b8c
This commit is contained in:
committed by
Copybot
parent
40c7f2dae1
commit
89b031a21a
@@ -22,7 +22,7 @@ export default function FileTreeImportFromUrl() {
|
||||
// set the name when the URL changes
|
||||
useEffect(() => {
|
||||
if (url) {
|
||||
const matches = url.match(/^https?:\/\/.+\/([^/]+\.(\w+))$/)
|
||||
const matches = url.match(/^\s*https?:\/\/.+\/([^/]+\.(\w+))\s*$/)
|
||||
setName(matches ? matches[1] : '')
|
||||
}
|
||||
}, [setName, url])
|
||||
@@ -39,7 +39,7 @@ export default function FileTreeImportFromUrl() {
|
||||
finishCreatingLinkedFile({
|
||||
name,
|
||||
provider: 'url',
|
||||
data: { url },
|
||||
data: { url: url.trim() },
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user