fix several rendering issues in markdown (#3588)
- fix double escaping of html entities: " instead of " - fix table is missing css class "table" - fix quotes are not rendered
This commit is contained in:
@@ -63,7 +63,7 @@ final class MarkdownExtension implements RuntimeExtensionInterface
|
||||
if ($this->isMarkdownEnabled()) {
|
||||
$content = $this->markdown->toHtml($content);
|
||||
} elseif ($fullLength) {
|
||||
$content = '<p>' . nl2br($content) . '</p>';
|
||||
$content = '<p>' . nl2br(htmlspecialchars($content)) . '</p>';
|
||||
}
|
||||
|
||||
return $content;
|
||||
@@ -115,7 +115,7 @@ final class MarkdownExtension implements RuntimeExtensionInterface
|
||||
return $this->markdown->toHtml($content);
|
||||
}
|
||||
|
||||
return nl2br($content);
|
||||
return nl2br(htmlspecialchars($content));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -45,8 +45,8 @@ class RuntimeExtensions extends AbstractExtension
|
||||
{
|
||||
return [
|
||||
new TwigFilter('md2html', [MarkdownExtension::class, 'markdownToHtml'], ['pre_escape' => 'html', 'is_safe' => ['html']]),
|
||||
new TwigFilter('desc2html', [MarkdownExtension::class, 'timesheetContent'], ['pre_escape' => 'html', 'is_safe' => ['html']]),
|
||||
new TwigFilter('comment2html', [MarkdownExtension::class, 'commentContent'], ['pre_escape' => 'html', 'is_safe' => ['html']]),
|
||||
new TwigFilter('desc2html', [MarkdownExtension::class, 'timesheetContent'], ['is_safe' => ['html']]),
|
||||
new TwigFilter('comment2html', [MarkdownExtension::class, 'commentContent'], ['is_safe' => ['html']]),
|
||||
new TwigFilter('comment1line', [MarkdownExtension::class, 'commentOneLiner'], ['pre_escape' => 'html', 'is_safe' => ['html']]),
|
||||
new TwigFilter('colorize', [ThemeExtension::class, 'colorize']),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user