File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -241,9 +241,9 @@ private function parseChangelog($pull)
241241 {
242242 $ changelog = array ();
243243 $ body = preg_replace ('/<!--(.*)-->/Uis ' , '' , $ pull ['body ' ]);
244- preg_match ('/## Changelog.*```markdown(.*)```.*/is ' , $ body , $ matches );
244+ preg_match ('/## Changelog.*```\s* markdown\s* \\ n (.*)\\ n ```.*/is ' , $ body , $ matches );
245245
246- if (false !== strpos ( $ body , ' ## Changelog ' ) && count ($ matches ) == 2 ) {
246+ if (count ($ matches ) == 2 ) {
247247 $ lines = explode (PHP_EOL , $ matches [1 ]);
248248
249249 $ section = '' ;
@@ -254,8 +254,8 @@ private function parseChangelog($pull)
254254 continue ;
255255 }
256256
257- if (false !== strpos ($ line , '### ' )) {
258- $ section = str_replace ( ' ### ' , '' , $ line );
257+ if (0 === strpos ($ line , '# ' )) {
258+ $ section = end ( explode ( ' ' , $ line) );
259259 } elseif (!empty ($ section )) {
260260 $ line = preg_replace ('/^- /i ' , '' , $ line );
261261 $ changelog [$ section ][] = '- [[# ' .$ pull ['number ' ].']( ' .$ pull ['html_url ' ].')] ' .
You can’t perform that action at this time.
0 commit comments