Skip to content

Commit 2500c8b

Browse files
committed
refactor: use WRAP_POINT from mdformat
1 parent 6f3edf0 commit 2500c8b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mdformat_mkdocs/_postprocess_inline.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from typing import TYPE_CHECKING
6+
from mdformat.renderer import WRAP_POINT
67

78
from ._helpers import FILLER_CHAR, MKDOCS_INDENT_COUNT, get_conf, rstrip_result
89

@@ -51,15 +52,14 @@ def postprocess_list_wrap(
5152
counter_ += 1
5253
indent_count = max(counter_, 0)
5354

54-
soft_break = "\x00"
55-
text = text.lstrip(soft_break).lstrip()
55+
text = text.lstrip(WRAP_POINT).lstrip()
5656
filler = (FILLER * indent_count)[:-1] if indent_count else ""
5757
newline_filler = filler + FILLER if indent_count else FILLER[:-1]
5858
if len(text) > wrap_mode:
5959
indent_length = MKDOCS_INDENT_COUNT * indent_count
6060
wrapped_length = -123
6161
words: list[str] = []
62-
for word in text.split(soft_break):
62+
for word in text.split(WRAP_POINT):
6363
next_length = wrapped_length + len(word)
6464
if not words:
6565
words = [filler, word]
@@ -70,5 +70,5 @@ def postprocess_list_wrap(
7070
else:
7171
words.append(word)
7272
wrapped_length = next_length + 1
73-
return soft_break.join(_w for _w in words if _w)
74-
return f"{filler}{soft_break}{text}" if filler else text
73+
return WRAP_POINT.join(_w for _w in words if _w)
74+
return f"{filler}{WRAP_POINT}{text}" if filler else text

0 commit comments

Comments
 (0)