diff --git a/src/Controller/SnipController.php b/src/Controller/SnipController.php index 8be508d..0bd6ca3 100644 --- a/src/Controller/SnipController.php +++ b/src/Controller/SnipController.php @@ -46,12 +46,12 @@ class SnipController extends AbstractController #[Route('/single/{snip}', name: '_single')] public function single(Snip $snip): Response { - $snipParser = new Pipeline(); $this->denyAccessUnlessGranted(SnipVoter::VIEW, $snip); + $snipService = $this->snipServiceFactory->create($snip); return $this->render('snip/single.html.twig', [ 'snip' => $snip, - 'content' => $snipParser->parse(($snipService->get())), + 'content' => (new Pipeline())->parse(($snipService->get())), 'branch' => $snipService->getRepo()->getCurrentBranchName(), ]); } diff --git a/src/Service/SnipParser/Pipeline.php b/src/Service/SnipParser/Pipeline.php index f31719a..7831b00 100644 --- a/src/Service/SnipParser/Pipeline.php +++ b/src/Service/SnipParser/Pipeline.php @@ -13,7 +13,8 @@ class Pipeline $builder = new PipelineBuilder(); $pipeline = $builder ->add(new HtmlEscapeStage()) - ->add(new ReplaceBlocksStage('
', '
', '```'))
+ ->add(new ReplaceBlocksStage('', '
', '```'))
+ ->add(new ReplaceBlocksStage('', '
', '``'))
->build();
return $pipeline->process($payload);
diff --git a/templates/snip/single.html.twig b/templates/snip/single.html.twig
index 59abe3e..ea93e3a 100644
--- a/templates/snip/single.html.twig
+++ b/templates/snip/single.html.twig
@@ -44,5 +44,11 @@
{% block js %}
{{ parent() }}
-
+
{% endblock %}
\ No newline at end of file