-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ODT exporting tables #274
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -646,7 +646,7 @@ function renderODTOpenTable ($renderer, $attr, $style, $attr_string) { | |
|
||
if ( empty($css_properties ['float']) === true ) { | ||
// If the float property is not set, set it to 'left' becuase the ODT plugin | ||
// would default to 'center' which is diffeent to the XHTML behaviour. | ||
// would default to 'center' which is different to the XHTML behaviour. | ||
//$css_properties ['float'] = 'left'; | ||
if (strpos ($class, 'wrap_left') !== false ) { | ||
$css_properties ['float'] = 'left'; | ||
|
@@ -668,10 +668,10 @@ function renderODTOpenTable ($renderer, $attr, $style, $attr_string) { | |
|
||
$background_color = $css_properties ['background-color']; | ||
$image = $css_properties ['background-image'] ?? null; | ||
$margin_top = $css_properties ['margin-top']; | ||
$margin_right = $css_properties ['margin-right']; | ||
$margin_bottom = $css_properties ['margin-bottom']; | ||
$margin_left = $css_properties ['margin-left']; | ||
$margin_top = $css_properties ['margin-top'] ?? '0cm'; | ||
$margin_right = $css_properties ['margin-right'] ?? '0cm'; | ||
$margin_bottom = $css_properties ['margin-bottom'] ?? '0cm'; | ||
$margin_left = $css_properties ['margin-left'] ?? '0cm'; | ||
$width = $attr ['width']; | ||
|
||
// Open 2x1 table if image is present | ||
|
@@ -692,7 +692,7 @@ function renderODTOpenTable ($renderer, $attr, $style, $attr_string) { | |
} | ||
$frame_props ['min-height'] = '1cm'; | ||
$frame_props ['width'] = $attr ['width']; | ||
$frame_props ['float'] = $css_properties ['float']; | ||
$frame_props ['float'] = $css_properties ['float'] ?? null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It isn't a CSS property, it's for PHP control only. On line https://github.com/selfthinker/dokuwiki_plugin_wrap/blob/master/helper.php#L709 PHP just checks if this value is null to proper set the margin and padding values to '0cm'. |
||
if ( self::$table_entr > 1 ) { | ||
$frame_props ['anchor-type'] = 'as-char'; | ||
} else { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 does not really need a unit. So '0' instead of '0cm' would be fine (and shorter).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, because it isn't exactly CSS, it uses ODT that uses a XML like syntax. If you do not specify the unit the ODT rendering on LibreOffice may fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok. I didn't realise that. I have no experience with ODT so I'll shut up now ;-)