File tree Expand file tree Collapse file tree 1 file changed +2
-28
lines changed
Expand file tree Collapse file tree 1 file changed +2
-28
lines changed Original file line number Diff line number Diff line change @@ -268,35 +268,9 @@ private function codeTitleToLines(DOMElement $codeElm)
268268 return [];
269269 }
270270
271- $ titleLines = [];
272- $ tempTitle = '' ;
273- $ words = explode (' ' , $ title );
274-
275- foreach ($ words as $ word ) {
276- if (strlen ($ tempTitle .$ word ) >= 45 ) {
277- if (strlen ($ tempTitle .$ word ) === 45 ) {
278- // Adding the extra space will push us to the edge
279- // so we are done.
280- $ titleLines [] = $ tempTitle .$ word ;
281- $ tempTitle = '' ;
282- } else if (strlen ($ tempTitle .$ word ) === 46 ) {
283- // We are already at the edge, so we are done.
284- $ titleLines [] = $ tempTitle .$ word ;
285- $ tempTitle = '' ;
286- } else {
287- $ titleLines [] = $ tempTitle ;
288- $ tempTitle = $ word .' ' ;
289- }
290- } else {
291- $ tempTitle .= $ word .' ' ;
292- }
293- }//end foreach
294-
295- if ($ tempTitle !== '' ) {
296- $ titleLines [] = $ tempTitle ;
297- }
271+ $ title = wordwrap ($ title , 46 , "\n" );
298272
299- return $ titleLines ;
273+ return explode ( "\n" , $ title ) ;
300274
301275 }//end codeTitleToLines()
302276
You can’t perform that action at this time.
0 commit comments