From b9604e39bdcbab223f0008c50cc9702d5a8799bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=CC=81ng?= Date: Thu, 27 Apr 2023 19:18:08 +0800 Subject: [PATCH] Try to fix unit test error. --- Michelf/MarkdownExtra.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Michelf/MarkdownExtra.php b/Michelf/MarkdownExtra.php index 638e30d..f814cde 100644 --- a/Michelf/MarkdownExtra.php +++ b/Michelf/MarkdownExtra.php @@ -1196,7 +1196,7 @@ class MarkdownExtra extends \Michelf\Markdown { $head = $matches[1]; $underline = $matches[2]; $content = $matches[3]; - $id_class = $matches[4]; + $id_class = $matches[4] ?? null; $content = preg_replace('/^ *[|]/m', '', $content); @@ -1226,7 +1226,7 @@ class MarkdownExtra extends \Michelf\Markdown { $head = $matches[1]; $underline = $matches[2]; $content = $matches[3]; - $id_class = $matches[4]; + $id_class = $matches[4] ?? null; $attr = []; // Remove any tailing pipes for each line. @@ -1256,7 +1256,7 @@ class MarkdownExtra extends \Michelf\Markdown { // Write column headers. $table_attr_str = $this->doExtraAttributes('table', $id_class, null, []); - $text = "\n"; + $text = "\n"; $text .= "\n"; $text .= "\n"; foreach ($headers as $n => $header) {