mirror of
https://github.com/James-Yu/LaTeX-Workshop.git
synced 2024-10-04 07:07:54 +03:00
Fix #297 Encode PDF path in viewer to support path containing #
This commit is contained in:
parent
e7b0594f14
commit
dc18c39298
@ -1,5 +1,9 @@
|
||||
# Change Log
|
||||
|
||||
## [3.6.1] - Unreleased
|
||||
### Fixed
|
||||
- (#297) PDF path can contain `#` now.
|
||||
|
||||
## [3.6.0] - 2017-11-01
|
||||
### Added
|
||||
- (#288) New `latex-workshop.intellisense.surroundCommand.enabled` config to control command surrounding feature.
|
||||
|
@ -3,7 +3,7 @@
|
||||
"displayName": "LaTeX Workshop",
|
||||
"description": "Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.",
|
||||
"icon": "icon.png",
|
||||
"version": "3.6.0",
|
||||
"version": "3.6.1",
|
||||
"publisher": "James-Yu",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/James-Yu/LaTeX-Workshop",
|
||||
|
@ -35,8 +35,10 @@ export class Server {
|
||||
if (!request.url) {
|
||||
return
|
||||
}
|
||||
request.url = decodeURIComponent(request.url)
|
||||
if (request.url.indexOf('pdf:') >= 0 && request.url.indexOf('viewer.html') < 0) {
|
||||
const fileName = decodeURIComponent(request.url).replace('/pdf:', '')
|
||||
// The second backslash was encoded as %2F, and the first one is prepended by request
|
||||
const fileName = request.url.replace('//pdf:', '')
|
||||
try {
|
||||
const pdfSize = fs.statSync(fileName).size
|
||||
response.writeHead(200, {'Content-Type': 'application/pdf', 'Content-Length': pdfSize})
|
||||
|
@ -5978,7 +5978,7 @@ var pdfjsWebLibs;
|
||||
return promise;
|
||||
},
|
||||
open: function pdfViewOpen(file, args) {
|
||||
console.log(file)
|
||||
file = encodeURIComponent(file)
|
||||
if (arguments.length > 2 || typeof args === 'number') {
|
||||
return Promise.reject(new Error('Call of open() with obsolete signature.'));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user