mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-11-02 13:44:20 +09:00
[utils] Handle single-line comments in js_to_json
This commit is contained in:
1 parent
a22b2fd19b
commit
b3ee552e4b
2 files changed
+5
-2
No files matched your search
@@ -791,6 +791,9 @@ class TestUtil(unittest.TestCase):
|
||||
on = js_to_json('{ 0: /* " \n */ ",]" , }')
|
||||
self.assertEqual(json.loads(on), {'0': ',]'})
|
||||
|
||||
on = js_to_json('{ 0: // comment\n1 }')
|
||||
self.assertEqual(json.loads(on), {'0': 1})
|
||||
|
||||
on = js_to_json(r'["<p>x<\/p>"]')
|
||||
self.assertEqual(json.loads(on), ['<p>x</p>'])
|
||||
|
||||
|
||||
Reference in new issue
Block a user