From 2c123577a18abe21ed7f62de347acc45dea9b5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93lafur=20P=C3=A1ll=20Geirsson?= Date: Sat, 12 Jun 2021 17:05:06 +0200 Subject: [PATCH] Don't use `.stripMargin` for live-reload server Previously, the built-in live-reload server for mdoc processed markdown output with `.stripMargin`. This meant that code examples using `.stripMargin` formatted strings would not be rendered correctly in the live-reload preview. This commit fixes that so that code examples with `.stripMargin` are properly rendered. --- .../mdoc/internal/livereload/SimpleHtml.scala | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/mdoc/src/main/scala/mdoc/internal/livereload/SimpleHtml.scala b/mdoc/src/main/scala/mdoc/internal/livereload/SimpleHtml.scala index 7f1cab1df..9c5a1b91a 100644 --- a/mdoc/src/main/scala/mdoc/internal/livereload/SimpleHtml.scala +++ b/mdoc/src/main/scala/mdoc/internal/livereload/SimpleHtml.scala @@ -23,31 +23,32 @@ object SimpleHtml { url: String ): String = { val toc = tableOfContents.toHTML(fromLevel = 2, toLevel = 3, indent = " ") - s"""| - | - | $title - | - | - | - | - | - | - | - | - |
- |
- | $body - |
- | - |
- | - | - |""".stripMargin + s""" + + + $title + + + + + + + + +
+
+ $body +
+ +
+ + +""" } }