@@ -19,7 +19,13 @@ export default parse;
1919 */
2020async function parse ( path : string , $refs : $Refs , options : Options ) {
2121 // 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+ }
2329
2430 // Add a new $Ref for this file, even though we don't have the value yet.
2531 // 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) {
2834 // This "file object" will be passed to all resolvers and parsers.
2935 const file = {
3036 url : path ,
37+ hash,
3138 extension : url . getExtension ( path ) ,
3239 } as FileInfo ;
3340
@@ -103,8 +110,6 @@ async function readFile(file: FileInfo, options: Options, $refs: $Refs): Promise
103110 * The promise resolves with the parsed file contents and the parser that was used.
104111 */
105112async function parseFile ( file : FileInfo , options : Options , $refs : $Refs ) {
106- // console.log('Parsing %s', file.url);
107-
108113 // Find the parsers that can read this file type.
109114 // If none of the parsers are an exact match for this file, then we'll try ALL of them.
110115 // This handles situations where the file IS a supported type, just with an unknown extension.
0 commit comments