Skip to content

Commit

Permalink
adjustments for PHP8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ternite committed Apr 11, 2023
1 parent 4063d01 commit ccda7f8
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions syntax.php
Expand Up @@ -103,7 +103,7 @@ function handle($match, $state, $pos, Doku_Handler $handler) {
return array($state, $match);

default:
return array($state);
return array($state, NULL);
}
}

Expand Down Expand Up @@ -267,25 +267,37 @@ protected function render_odt_new ($renderer, $state, $data) {
$renderer->tablerow_open();

$properties = array();
$properties ['vertical-align'] = $css_properties ['vertical-align'];
if (array_key_exists('vertical-align', $properties)) {
$properties ['vertical-align'] = $css_properties ['vertical-align'];
}
$properties ['text-align'] = 'center';
$properties ['padding'] = '0.1cm';
$properties ['border'] = '0.002cm solid #000000';
$properties ['background-color'] = $css_properties ['background-color'];
if (array_key_exists('background-color', $properties)) {
$properties ['background-color'] = $css_properties ['background-color'];
}
$renderer->_odtTableCellOpenUseProperties($properties);

if ($css_properties ['background-image']) {
$renderer->_odtAddImage($css_properties ['background-image']);
if (array_key_exists('background-image', $css_properties)) {
if ($css_properties ['background-image'] ?? null) {
$renderer->_odtAddImage($css_properties ['background-image']);
}
}

$renderer->tablecell_close();

$properties = array();
$properties ['vertical-align'] = $css_properties ['vertical-align'];
$properties ['text-align'] = $css_properties ['text-align'];
if (array_key_exists('vertical-align', $css_properties)) {
$properties ['vertical-align'] = $css_properties ['vertical-align'];
}
if (array_key_exists('text-align', $css_properties)) {
$properties ['text-align'] = $css_properties ['text-align'];
}
$properties ['padding'] = '0.3cm';
$properties ['border'] = '0.002cm solid #000000';
$properties ['background-color'] = $css_properties ['background-color'];
if (array_key_exists('background-color', $css_properties)) {
$properties ['background-color'] = $css_properties ['background-color'];
}
$renderer->_odtTableCellOpenUseProperties($properties);
$renderer->p_close(); // needed here - since _odtTableCellOpenUseProperties opens a paragraph automatically that has a different paragraph formatting/style
break;
Expand Down

0 comments on commit ccda7f8

Please sign in to comment.