We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
str.removesuffix
1 parent c5161b5 commit 0c933dcCopy full SHA for 0c933dc
markdown_it/tree.py
@@ -162,7 +162,7 @@ def type(self) -> str:
162
if self.token:
163
return self.token.type
164
assert self.nester_tokens
165
- return _removesuffix(self.nester_tokens.opening.type, "_open")
+ return self.nester_tokens.opening.type.removesuffix("_open")
166
167
@property
168
def next_sibling(self: _NodeType) -> _NodeType | None:
@@ -331,14 +331,3 @@ def hidden(self) -> bool:
331
"""If it's true, ignore this element when rendering.
332
Used for tight lists to hide paragraphs."""
333
return self._attribute_token().hidden
334
-
335
336
-def _removesuffix(string: str, suffix: str) -> str:
337
- """Remove a suffix from a string.
338
339
- Replace this with str.removesuffix() from stdlib when minimum Python
340
- version is 3.9.
341
- """
342
- if suffix and string.endswith(suffix):
343
- return string[: -len(suffix)]
344
- return string
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments