Skip to content

Commit 0cb745f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 649403a commit 0cb745f

27 files changed

+0
-33
lines changed

markdown_it/common/utils.py

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def arrayReplaceAt(src: list, pos: int, newElements: list) -> list:
5656

5757

5858
def isValidEntityCode(c: int) -> bool:
59-
6059
# broken sequence
6160
if c >= 0xD800 and c <= 0xDFFF:
6261
return False

markdown_it/helpers/parse_link_label.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010

1111
def parseLinkLabel(state: StateInline, start: int, disableNested: bool = False) -> int:
12-
1312
labelEnd = -1
1413
oldPos = state.pos
1514
found = False

markdown_it/renderer.py

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def render(
8282
result = ""
8383

8484
for i, token in enumerate(tokens):
85-
8685
if token.type == "inline":
8786
assert token.children is not None
8887
result += self.renderInline(token.children, options, env)

markdown_it/rules_block/blockquote.py

-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
def blockquote(state: StateBlock, startLine: int, endLine: int, silent: bool):
13-
1413
LOGGER.debug(
1514
"entering blockquote: %s, %s, %s, %s", state, startLine, endLine, silent
1615
)
@@ -129,7 +128,6 @@ def blockquote(state: StateBlock, startLine: int, endLine: int, silent: bool):
129128
# for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
130129
nextLine = startLine + 1
131130
while nextLine < endLine:
132-
133131
# check if it's outdented, i.e. it's inside list item and indented
134132
# less than said list item:
135133
#

markdown_it/rules_block/code.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
def code(state: StateBlock, startLine: int, endLine: int, silent: bool = False):
10-
1110
LOGGER.debug("entering code: %s, %s, %s, %s", state, startLine, endLine, silent)
1211

1312
if state.sCount[startLine] - state.blkIndent < 4:

markdown_it/rules_block/fence.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
def fence(state: StateBlock, startLine: int, endLine: int, silent: bool):
10-
1110
LOGGER.debug("entering fence: %s, %s, %s, %s", state, startLine, endLine, silent)
1211

1312
haveEndMarker = False

markdown_it/rules_block/heading.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
def heading(state: StateBlock, startLine: int, endLine: int, silent: bool):
13-
1413
LOGGER.debug("entering heading: %s, %s, %s, %s", state, startLine, endLine, silent)
1514

1615
pos = state.bMarks[startLine] + state.tShift[startLine]

markdown_it/rules_block/hr.py

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212

1313
def hr(state: StateBlock, startLine: int, endLine: int, silent: bool):
14-
1514
LOGGER.debug("entering hr: %s, %s, %s, %s", state, startLine, endLine, silent)
1615

1716
pos = state.bMarks[startLine] + state.tShift[startLine]

markdown_it/rules_block/lheading.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
def lheading(state: StateBlock, startLine: int, endLine: int, silent: bool):
11-
1211
LOGGER.debug("entering lheading: %s, %s, %s, %s", state, startLine, endLine, silent)
1312

1413
level = None

markdown_it/rules_block/list.py

-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# Search `[-+*][\n ]`, returns next pos after marker on success
1111
# or -1 on fail.
1212
def skipBulletListMarker(state: StateBlock, startLine: int):
13-
1413
pos = state.bMarks[startLine] + state.tShift[startLine]
1514
maximum = state.eMarks[startLine]
1615

@@ -33,7 +32,6 @@ def skipBulletListMarker(state: StateBlock, startLine: int):
3332
# Search `\d+[.)][\n ]`, returns next pos after marker on success
3433
# or -1 on fail.
3534
def skipOrderedListMarker(state: StateBlock, startLine: int):
36-
3735
start = state.bMarks[startLine] + state.tShift[startLine]
3836
pos = start
3937
maximum = state.eMarks[startLine]
@@ -59,7 +57,6 @@ def skipOrderedListMarker(state: StateBlock, startLine: int):
5957

6058
# /* 0 */ /* 9 */
6159
if ch >= 0x30 and ch <= 0x39:
62-
6360
# List marker should have no more than 9 digits
6461
# (prevents integer overflow in browsers)
6562
if pos - start >= 10:
@@ -97,7 +94,6 @@ def markTightParagraphs(state: StateBlock, idx: int):
9794

9895

9996
def list_block(state: StateBlock, startLine: int, endLine: int, silent: bool):
100-
10197
LOGGER.debug("entering list: %s, %s, %s, %s", state, startLine, endLine, silent)
10298

10399
isTerminatingParagraph = False

markdown_it/rules_block/paragraph.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
def paragraph(state: StateBlock, startLine: int, endLine: int, silent: bool = False):
11-
1211
LOGGER.debug(
1312
"entering paragraph: %s, %s, %s, %s", state, startLine, endLine, silent
1413
)

markdown_it/rules_block/reference.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
def reference(state: StateBlock, startLine, _endLine, silent):
10-
1110
LOGGER.debug(
1211
"entering reference: %s, %s, %s, %s", state, startLine, _endLine, silent
1312
)

markdown_it/rules_block/state_block.py

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def __init__(
1919
tokens: list[Token],
2020
srcCharCode: tuple[int, ...] | None = None,
2121
):
22-
2322
if srcCharCode is not None:
2423
self._src = src
2524
self.srcCharCode = srcCharCode

markdown_it/rules_core/block.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44

55
def block(state: StateCore) -> None:
6-
76
if state.inlineMode:
87
token = Token("inline", "", 0)
98
token.content = state.src

markdown_it/rules_core/normalize.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010

1111
def normalize(state: StateCore) -> None:
12-
1312
# Normalize newlines
1413
string = NEWLINES_RE.sub("\n", state.src)
1514

markdown_it/rules_core/smartquotes.py

-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ def smartquotes(state: StateCore) -> None:
195195
return
196196

197197
for token in state.tokens:
198-
199198
if token.type != "inline" or not QUOTE_RE.search(token.content):
200199
continue
201200
assert token.children is not None

markdown_it/rules_inline/autolink.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
def autolink(state: StateInline, silent: bool) -> bool:
13-
1413
pos = state.pos
1514

1615
if state.srcCharCode[pos] != 0x3C: # /* < */

markdown_it/rules_inline/backticks.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
def backtick(state: StateInline, silent: bool) -> bool:
10-
1110
pos = state.pos
1211
ch = state.srcCharCode[pos]
1312

markdown_it/rules_inline/balance_pairs.py

-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
def processDelimiters(state: StateInline, delimiters, *args):
7-
87
openersBottom = {}
98
maximum = len(delimiters)
109

@@ -50,7 +49,6 @@ def processDelimiters(state: StateInline, delimiters, *args):
5049
continue
5150

5251
if opener.open and opener.end < 0:
53-
5452
isOddMatch = False
5553

5654
# from spec:

markdown_it/rules_inline/emphasis.py

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def tokenize(state: StateInline, silent: bool):
3939

4040

4141
def _postProcess(state, delimiters):
42-
4342
i = len(delimiters) - 1
4443
while i >= 0:
4544
startDelim = delimiters[i]

markdown_it/rules_inline/entity.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
def entity(state: StateInline, silent: bool):
13-
1413
pos = state.pos
1514
maximum = state.posMax
1615

markdown_it/rules_inline/html_inline.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ def isLetter(ch: int):
1010

1111

1212
def html_inline(state: StateInline, silent: bool):
13-
1413
pos = state.pos
1514

1615
if not state.md.options.get("html", None):

markdown_it/rules_inline/image.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
def image(state: StateInline, silent: bool):
10-
1110
label = None
1211
href = ""
1312
oldPos = state.pos

markdown_it/rules_inline/link.py

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
def link(state: StateInline, silent: bool):
8-
98
href = ""
109
title = ""
1110
label = None

markdown_it/rules_inline/strikethrough.py

-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def tokenize(state: StateInline, silent: bool):
5353

5454

5555
def _postProcess(state: StateInline, delimiters: list[Delimiter]):
56-
5756
loneMarkers = []
5857
maximum = len(delimiters)
5958

@@ -89,7 +88,6 @@ def _postProcess(state: StateInline, delimiters: list[Delimiter]):
8988
state.tokens[endDelim.token - 1].type == "text"
9089
and state.tokens[endDelim.token - 1].content == "~"
9190
):
92-
9391
loneMarkers.append(endDelim.token - 1)
9492

9593
i += 1

markdown_it/token.py

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def convert_attrs(value: Any) -> Any:
2222

2323
@dc.dataclass(**DATACLASS_KWARGS)
2424
class Token:
25-
2625
type: str
2726
"""Type of the token (string, e.g. "paragraph_open")"""
2827

tests/test_port/test_references.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
def test_ref_definitions():
5-
65
md = MarkdownIt()
76
src = "[a]: abc\n\n[b]: xyz\n\n[b]: ijk"
87
env = {}

0 commit comments

Comments
 (0)