File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 39
39
FragmentLoader = Callable [[Fragment , Mapping [str , Directive ]], Optional [Fragment ]]
40
40
41
41
42
- RELATIVE_PATH_REGEX = re .compile (r"^(?:assets|data)(?:/[a-zA-Z0-9_.]+)+$" )
42
+ RELATIVE_PATH_REGEX = re .compile (
43
+ r"^(?:[a-zA-Z0-9_.]+/)?(assets|data)(?:/[a-zA-Z0-9_.]+)+$"
44
+ )
43
45
44
46
45
47
class Extractor :
@@ -332,10 +334,10 @@ def parse_fragments(
332
334
and (
333
335
match := regex .match (inline := inline .children [0 ].content )
334
336
or (
335
- RELATIVE_PATH_REGEX .match (inline )
337
+ ( directory := RELATIVE_PATH_REGEX .match (inline ) )
336
338
and (
337
339
directive := "@resource_pack"
338
- if inline . startswith ( "assets" )
340
+ if directory [ 0 ] == "assets"
339
341
else "@data_pack"
340
342
)
341
343
and regex .match (f"{ directive } { inline } " )
You can’t perform that action at this time.
0 commit comments