From 3daa29d742190acba6ce53e311150e1745e388f5 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 16 Sep 2016 08:16:25 +0200 Subject: [PATCH] fix helpers (coma in title) --- news2markdown.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/news2markdown.php b/news2markdown.php index f14b5fa..a4cbee9 100755 --- a/news2markdown.php +++ b/news2markdown.php @@ -8,11 +8,12 @@ $text = file_get_contents($_SERVER['argv'][1]); if (!$text) { die("Can't read {$_SERVER['argv'][1]}\n"); } +$debug = (isset($_SERVER['argv'][2]) && $_SERVER['argv'][2]==-'d'); $text = explode("\n", $text); $in=false; foreach ($text as $line) { - if (preg_match('/(^[0-9][0-9] ... 20[0-9][0-9]) PHP (.*)$/', $line, $reg)) { + if (preg_match('/(^[0-9][0-9] ... 20[0-9][0-9])[,]* PHP (.*)$/', $line, $reg)) { if ($in) { break; } @@ -20,6 +21,7 @@ foreach ($text as $line) { $in = true; continue; } else if (!$in) { + if ($debug) echo "+ Ignore $line\n"; continue; } $line = preg_replace('/(#[0-9])+/', 'php\1', $line);