We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b4d67e commit b283c2bCopy full SHA for b283c2b
text-document.rkt
@@ -24,7 +24,16 @@
24
(string-prefix? str "file://"))
25
26
(define (uri->path uri)
27
- (substring uri 7))
+ (cond
28
+ [(eq? (system-type 'os) 'windows)
29
+ ;; If a file URI begins with file:// or file:////, Windows translates it
30
+ ;; as a UNC path. If it begins with file:///, it's translated to an MS-DOS
31
+ ;; path. (https://en.wikipedia.org/wiki/File_URI_scheme#Windows_2)
32
33
+ [(string-prefix? uri "file:////") (substring uri 7)]
34
+ [(string-prefix? uri "file:///") (substring uri 8)]
35
+ [else (string-append "//" (substring uri 7))])]
36
+ [else (substring uri 7)]))
37
38
(define (abs-pos->Pos t pos)
39
(define line (send t position-paragraph pos))
0 commit comments