File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,9 @@ def discover(source):
3535 possibilities = source
3636
3737 for line in set (possibilities ):
38- if line [:21 ] == '//@ sourceMappingURL=' :
39- # We want everything AFTER the indicator, which is 21 chars long
38+ pragma = line [:21 ]
39+ if pragma == '//# sourceMappingURL=' or pragma == '//@ sourceMappingURL=' :
40+ # We want everything AFTER the pragma, which is 21 chars long
4041 return line [21 :].rstrip ()
4142 # XXX: Return None or raise an exception?
4243 return None
Original file line number Diff line number Diff line change @@ -12,6 +12,15 @@ def test_finds_sourcemap(self):
1212this is some code
1313it's really awesome
1414//@ sourceMappingURL=file.js
15+ """
16+ self .assertFoundSourcemap (fixture , 'file.js' )
17+
18+ def test_finds_sourcemap_alt (self ):
19+ fixture = """
20+ hey
21+ this is some code
22+ it's really awesome
23+ //# sourceMappingURL=file.js
1524"""
1625 self .assertFoundSourcemap (fixture , 'file.js' )
1726
You can’t perform that action at this time.
0 commit comments