File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1206,7 +1206,17 @@ public function getText(int $id = 0): string
12061206 $ bb = $ this ->bbcodes [$ this ->data [$ id ]['tag ' ]];
12071207
12081208 if (null === $ bb ['text_handler ' ]) {
1209- return $ body ;
1209+ if (
1210+ isset ($ body [0 ])
1211+ && 'inline ' !== $ bb ['type ' ]
1212+ ) {
1213+ $ before = preg_match ('%^\s%su ' , $ body ) ? '' : ' ' ;
1214+ $ after = preg_match ('%\s$%sDu ' , $ body ) ? '' : ' ' ;
1215+
1216+ return $ before . $ body . $ after ;
1217+ } else {
1218+ return $ body ;
1219+ }
12101220 }
12111221
12121222 $ attrs = [];
Original file line number Diff line number Diff line change 140140
141141#output:
142142#
143- # Position Astronaut Commander Neil A. Armstrong Command Module Pilot Michael Collins Lunar Module Pilot Edwin "Buzz" E. Aldrin, Jr.
143+ # Position Astronaut Commander Neil A. Armstrong Command Module Pilot Michael Collins Lunar Module Pilot Edwin "Buzz" E. Aldrin, Jr.
144144#My email spam@mail.ru
145145#superspam@mail.ru
146146#
You can’t perform that action at this time.
0 commit comments