Try to fix unit test error.

This commit is contained in:
Míng 2023-04-27 19:18:08 +08:00
parent fbc3604077
commit b9604e39bd

View file

@ -1196,7 +1196,7 @@ class MarkdownExtra extends \Michelf\Markdown {
$head = $matches[1]; $head = $matches[1];
$underline = $matches[2]; $underline = $matches[2];
$content = $matches[3]; $content = $matches[3];
$id_class = $matches[4]; $id_class = $matches[4] ?? null;
$content = preg_replace('/^ *[|]/m', '', $content); $content = preg_replace('/^ *[|]/m', '', $content);
@ -1226,7 +1226,7 @@ class MarkdownExtra extends \Michelf\Markdown {
$head = $matches[1]; $head = $matches[1];
$underline = $matches[2]; $underline = $matches[2];
$content = $matches[3]; $content = $matches[3];
$id_class = $matches[4]; $id_class = $matches[4] ?? null;
$attr = []; $attr = [];
// Remove any tailing pipes for each line. // Remove any tailing pipes for each line.
@ -1256,7 +1256,7 @@ class MarkdownExtra extends \Michelf\Markdown {
// Write column headers. // Write column headers.
$table_attr_str = $this->doExtraAttributes('table', $id_class, null, []); $table_attr_str = $this->doExtraAttributes('table', $id_class, null, []);
$text = "<table {$table_attr_str}>\n"; $text = "<table$table_attr_str>\n";
$text .= "<thead>\n"; $text .= "<thead>\n";
$text .= "<tr>\n"; $text .= "<tr>\n";
foreach ($headers as $n => $header) { foreach ($headers as $n => $header) {