Skip to content

Commit 765dfd2

Browse files
committed
Make meta default a dict
1 parent 935efa1 commit 765dfd2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+174
-174
lines changed

markdown_it/token.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Token:
3030
# fence infostring
3131
info: str = attr.ib(default="")
3232
# A place for plugins to store an arbitrary data
33-
meta: Optional[dict] = attr.ib(default=None)
33+
meta: dict = attr.ib(factory=dict)
3434
# True for block-level tokens, false for inline tokens.
3535
# Used in renderer to calculate line breaks
3636
block: bool = attr.ib(default=False)

tests/test_api/test_token.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_token():
1414
"content": "",
1515
"markup": "",
1616
"info": "",
17-
"meta": None,
17+
"meta": {},
1818
"block": False,
1919
"hidden": False,
2020
}

tests/test_footnote/test_footnote.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_footnote_def():
4242
"content": "",
4343
"markup": "",
4444
"info": "",
45-
"meta": None,
45+
"meta": {},
4646
"block": True,
4747
"hidden": False,
4848
},
@@ -57,7 +57,7 @@ def test_footnote_def():
5757
"content": "xyz",
5858
"markup": "",
5959
"info": "",
60-
"meta": None,
60+
"meta": {},
6161
"block": True,
6262
"hidden": False,
6363
},
@@ -72,7 +72,7 @@ def test_footnote_def():
7272
"content": "",
7373
"markup": "",
7474
"info": "",
75-
"meta": None,
75+
"meta": {},
7676
"block": True,
7777
"hidden": False,
7878
},
@@ -87,7 +87,7 @@ def test_footnote_def():
8787
"content": "",
8888
"markup": "",
8989
"info": "",
90-
"meta": None,
90+
"meta": {},
9191
"block": False,
9292
"hidden": False,
9393
},
@@ -170,7 +170,7 @@ def test_footnote_inline():
170170
content="a",
171171
markup="",
172172
info="",
173-
meta=None,
173+
meta={},
174174
block=False,
175175
hidden=False,
176176
)
@@ -214,7 +214,7 @@ def test_footnote_tail():
214214
"content": "",
215215
"markup": "",
216216
"info": "",
217-
"meta": None,
217+
"meta": {},
218218
"block": True,
219219
"hidden": False,
220220
}
@@ -231,7 +231,7 @@ def test_footnote_tail():
231231
"content": "xyz",
232232
"markup": "",
233233
"info": "",
234-
"meta": None,
234+
"meta": {},
235235
"block": True,
236236
"hidden": False,
237237
}
@@ -248,7 +248,7 @@ def test_footnote_tail():
248248
"content": "",
249249
"markup": "",
250250
"info": "",
251-
"meta": None,
251+
"meta": {},
252252
"block": True,
253253
"hidden": False,
254254
}
@@ -265,7 +265,7 @@ def test_footnote_tail():
265265
"content": "",
266266
"markup": "",
267267
"info": "",
268-
"meta": None,
268+
"meta": {},
269269
"block": False,
270270
"hidden": False,
271271
}
@@ -287,7 +287,7 @@ def test_footnote_tail():
287287
content="",
288288
markup="",
289289
info="",
290-
meta=None,
290+
meta={},
291291
block=False,
292292
hidden=False,
293293
),
@@ -302,7 +302,7 @@ def test_footnote_tail():
302302
content="",
303303
markup="",
304304
info="",
305-
meta=None,
305+
meta={},
306306
block=False,
307307
hidden=False,
308308
),
@@ -332,7 +332,7 @@ def test_footnote_tail():
332332
content="",
333333
markup="",
334334
info="",
335-
meta=None,
335+
meta={},
336336
block=True,
337337
hidden=False,
338338
),
@@ -347,7 +347,7 @@ def test_footnote_tail():
347347
content="xyz",
348348
markup="",
349349
info="",
350-
meta=None,
350+
meta={},
351351
block=True,
352352
hidden=False,
353353
),
@@ -377,7 +377,7 @@ def test_footnote_tail():
377377
content="",
378378
markup="",
379379
info="",
380-
meta=None,
380+
meta={},
381381
block=True,
382382
hidden=False,
383383
),
@@ -392,7 +392,7 @@ def test_footnote_tail():
392392
content="",
393393
markup="",
394394
info="",
395-
meta=None,
395+
meta={},
396396
block=False,
397397
hidden=False,
398398
),
@@ -407,7 +407,7 @@ def test_footnote_tail():
407407
content="",
408408
markup="",
409409
info="",
410-
meta=None,
410+
meta={},
411411
block=False,
412412
hidden=False,
413413
),

tests/test_math/test_math.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_inline_func():
3131
"content": "a=1",
3232
"markup": "$",
3333
"info": "",
34-
"meta": None,
34+
"meta": {},
3535
"block": False,
3636
"hidden": False,
3737
}
@@ -56,7 +56,7 @@ def test_block_func():
5656
"content": "\\na=1\\n\\nc\\nb=2",
5757
"markup": "$$",
5858
"info": "abc",
59-
"meta": None,
59+
"meta": {},
6060
"block": True,
6161
"hidden": False,
6262
}

tests/test_math/test_math/0_True_single characte.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
level: 0
1111
map: null
1212
markup: $
13-
meta: null
13+
meta: {}
1414
nesting: 0
1515
tag: math
1616
type: math_single
@@ -22,7 +22,7 @@
2222
- 0
2323
- 1
2424
markup: ''
25-
meta: null
25+
meta: {}
2626
nesting: 0
2727
tag: ''
2828
type: inline

tests/test_math/test_math/10_True_exponentiation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
level: 0
1111
map: null
1212
markup: $
13-
meta: null
13+
meta: {}
1414
nesting: 0
1515
tag: math
1616
type: math_inline
@@ -22,7 +22,7 @@
2222
- 0
2323
- 1
2424
markup: ''
25-
meta: null
25+
meta: {}
2626
nesting: 0
2727
tag: ''
2828
type: inline

tests/test_math/test_math/11_True_conjugate compl.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
level: 0
1111
map: null
1212
markup: $
13-
meta: null
13+
meta: {}
1414
nesting: 0
1515
tag: math
1616
type: math_inline
@@ -23,7 +23,7 @@
2323
level: 0
2424
map: null
2525
markup: ''
26-
meta: null
26+
meta: {}
2727
nesting: 0
2828
tag: ''
2929
type: text
@@ -36,7 +36,7 @@
3636
level: 0
3737
map: null
3838
markup: $
39-
meta: null
39+
meta: {}
4040
nesting: 0
4141
tag: math
4242
type: math_inline
@@ -48,7 +48,7 @@
4848
- 0
4949
- 1
5050
markup: ''
51-
meta: null
51+
meta: {}
5252
nesting: 0
5353
tag: ''
5454
type: inline

tests/test_math/test_math/12_True_single block eq.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
level: 0
88
map: null
99
markup: $$
10-
meta: null
10+
meta: {}
1111
nesting: 0
1212
tag: math
1313
type: math_block

tests/test_math/test_math/13_True_display equatio.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
level: 0
88
map: null
99
markup: $$
10-
meta: null
10+
meta: {}
1111
nesting: 0
1212
tag: math
1313
type: math_block

tests/test_math/test_math/14_True_inline equation.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
level: 0
1111
map: null
1212
markup: $
13-
meta: null
13+
meta: {}
1414
nesting: 0
1515
tag: math
1616
type: math_inline
@@ -22,7 +22,7 @@
2222
- 0
2323
- 1
2424
markup: ''
25-
meta: null
25+
meta: {}
2626
nesting: 0
2727
tag: ''
2828
type: inline
@@ -35,7 +35,7 @@
3535
level: 0
3636
map: null
3737
markup: ''
38-
meta: null
38+
meta: {}
3939
nesting: -1
4040
tag: p
4141
type: paragraph_close

0 commit comments

Comments
 (0)