@@ -19,7 +19,13 @@ export default parse;
19
19
*/
20
20
async function parse ( path : string , $refs : $Refs , options : Options ) {
21
21
// Remove the URL fragment, if any
22
- path = url . stripHash ( path ) ;
22
+ const hashIndex = path . indexOf ( "#" ) ;
23
+ let hash = "" ;
24
+ if ( hashIndex >= 0 ) {
25
+ hash = path . substring ( hashIndex ) ;
26
+ // Remove the URL fragment, if any
27
+ path = path . substring ( 0 , hashIndex ) ;
28
+ }
23
29
24
30
// Add a new $Ref for this file, even though we don't have the value yet.
25
31
// This ensures that we don't simultaneously read & parse the same file multiple times
@@ -28,6 +34,7 @@ async function parse(path: string, $refs: $Refs, options: Options) {
28
34
// This "file object" will be passed to all resolvers and parsers.
29
35
const file = {
30
36
url : path ,
37
+ hash,
31
38
extension : url . getExtension ( path ) ,
32
39
} as FileInfo ;
33
40
@@ -103,8 +110,6 @@ async function readFile(file: FileInfo, options: Options, $refs: $Refs): Promise
103
110
* The promise resolves with the parsed file contents and the parser that was used.
104
111
*/
105
112
async function parseFile ( file : FileInfo , options : Options , $refs : $Refs ) {
106
- // console.log('Parsing %s', file.url);
107
-
108
113
// Find the parsers that can read this file type.
109
114
// If none of the parsers are an exact match for this file, then we'll try ALL of them.
110
115
// This handles situations where the file IS a supported type, just with an unknown extension.
0 commit comments