File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 11- package : markdown-it/markdown-it
2- version : 12.3.1
3- commit : 76469e83dc1a1e3ed943b483b554003a666bddf7
4- date : Jan 7 , 2022
2+ version : 12.3.2
3+ commit : d72c68b520cedacae7878caa92bf7fe32e3e0e6f
4+ date : Jan 8 , 2022
55 notes :
66 - Rename variables that use python built-in names, e.g.
77 - ` max` -> `maximum`
Original file line number Diff line number Diff line change 1- # Proceess '\n'
2- import re
3-
1+ """Proceess '\n '."""
42from ..common .utils import charStrAt , isStrSpace
53from .state_inline import StateInline
64
7- endSpace = re .compile (r" +$" )
8-
95
106def newline (state : StateInline , silent : bool ) -> bool :
117 pos = state .pos
@@ -23,7 +19,12 @@ def newline(state: StateInline, silent: bool) -> bool:
2319 if not silent :
2420 if pmax >= 0 and charStrAt (state .pending , pmax ) == " " :
2521 if pmax >= 1 and charStrAt (state .pending , pmax - 1 ) == " " :
26- state .pending = endSpace .sub ("" , state .pending )
22+ # Find whitespaces tail of pending chars.
23+ ws = pmax - 1
24+ while ws >= 1 and charStrAt (state .pending , ws - 1 ) == " " :
25+ ws -= 1
26+ state .pending = state .pending [:ws ]
27+
2728 state .push ("hardbreak" , "br" , 0 )
2829 else :
2930 state .pending = state .pending [:- 1 ]
You can’t perform that action at this time.
0 commit comments