From c3f4e61e413545a444d2918ada54f2e34f76d775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Tue, 29 Nov 2022 00:29:53 +0100 Subject: [PATCH] Removed the useless margin below the description text in Parts table This fixes issue #192 --- assets/css/app.css | 6 +++++- src/Services/MarkdownParser.php | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/assets/css/app.css b/assets/css/app.css index 37c57b8a..fef6fb86 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -743,6 +743,10 @@ th.select-checkbox { margin-right: 0.2em; } +.markdown-inline p { + margin-block-end: 0; +} + /********************************* Workarounds *********************************/ @@ -877,4 +881,4 @@ table.dataTable tr.selected td.select-checkbox:after, table.dataTable tr.selecte .permission-checkbox:checked { background-color: var(--bs-success); border-color: var(--bs-success); -} \ No newline at end of file +} diff --git a/src/Services/MarkdownParser.php b/src/Services/MarkdownParser.php index 076807a5..1baacf0e 100644 --- a/src/Services/MarkdownParser.php +++ b/src/Services/MarkdownParser.php @@ -61,14 +61,15 @@ class MarkdownParser * The rendering of markdown is done on client side. * * @param string $markdown the markdown text that should be parsed to html - * @param bool $inline_mode Only allow inline markdown codes like (*bold* or **italic**), not something like tables + * @param bool $inline_mode When true, p blocks will have no margins behind them * * @return string the markdown in a version that can be parsed on client side */ public function markForRendering(string $markdown, bool $inline_mode = false): string { return sprintf( - '
%s
', + '
%s
', + $inline_mode ? 'markdown-inline' : '', //Add class if inline mode is enabled, to prevent margin after p htmlspecialchars($markdown), $this->translator->trans('markdown.loading') );