mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 10:56:32 +00:00
fix(pdf): support the raw path under win32 that included backslash for pdf local resource
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import path from 'path'
|
||||
|
||||
if (typeof window === 'undefined') {
|
||||
global.window = {}
|
||||
}
|
||||
@@ -265,4 +267,15 @@ export const writeClipboard = (text, isHtml) => {
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const toPosixPath = (input) => {
|
||||
return input && input.replace(/\\+/g, '/')
|
||||
}
|
||||
|
||||
export const nodePath = Object.assign({}, path, {
|
||||
basename (input) {
|
||||
input = toPosixPath(input)
|
||||
return path.basename(input)
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user