File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -60,18 +60,21 @@ def postprocess_list_wrap(
6060 indent_length = MKDOCS_INDENT_COUNT * indent_count
6161 wrapped_length = - 1 * wrap_mode
6262 words : list [str ] = []
63- for word in text .split (WRAP_POINT ):
63+ split = text .split (WRAP_POINT )
64+ for idx , word in enumerate (split ):
6465 next_length = wrapped_length + len (word )
6566 if not words :
6667 words = [filler , word ]
6768 wrapped_length = indent_length + len (word )
6869 elif next_length > wrap_mode :
69- words += [word , newline_filler ]
70- wrapped_length = indent_length + len (word )
70+ if idx < len (split ) - 1 :
71+ words += [word , newline_filler ]
72+ wrapped_length = indent_length + len (word )
73+ else :
74+ words .append (word )
75+ wrapped_length = len (word )
7176 else :
7277 words .append (word )
7378 wrapped_length = next_length + 1
74- if len (words ) and words [- 1 ] == FILLER_CHAR :
75- words .pop ()
7679 return WRAP_POINT .join (_w for _w in words if _w )
7780 return f"{ filler } { WRAP_POINT } { text } " if filler else text
You can’t perform that action at this time.
0 commit comments