From 03c3dead94a0461f90c7544df7238cfd8d5af175 Mon Sep 17 00:00:00 2001 From: Konrad Hinsen Date: Thu, 28 Dec 2023 11:18:24 +0100 Subject: [PATCH] Wrap exported method source code with a
 tag

The  tag doesn't preserve the line structure on its own, it
needs to be wrapped in an additional 
.

See
https://html.spec.whatwg.org/multipage/grouping-content.html#the-pre-element
---
 .../LeHtmlTextSnippetAnnotationVisitor.class.st       | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/Lepiter-HTML/LeHtmlTextSnippetAnnotationVisitor.class.st b/src/Lepiter-HTML/LeHtmlTextSnippetAnnotationVisitor.class.st
index fa129bbd4..6441656aa 100644
--- a/src/Lepiter-HTML/LeHtmlTextSnippetAnnotationVisitor.class.st
+++ b/src/Lepiter-HTML/LeHtmlTextSnippetAnnotationVisitor.class.st
@@ -153,10 +153,13 @@ LeHtmlTextSnippetAnnotationVisitor >> visitMethodAnnotation: aMethodAnnotation [
 							ifTrue: [ 'expanded-annotation-view' ]
 							ifFalse: [ 'collapsed-annotation-view' ]}}
 		do: [ 
-			context html 
-				inlineTag: 'code'
-				attributes: #('class' '')
-				with: method sourceCode ]
+			context html
+				inlineTag: 'pre'
+				do: [
+					context html
+						inlineTag: 'code'
+						attributes: #('class' '')
+						with: method sourceCode ] ]
 ]
 
 { #category : #generated }