@@ -318,7 +318,7 @@ public struct HtmlRenderer: MarkupWalker {
318
318
let lineCount = lines. count
319
319
320
320
// Build the HTML for the code block
321
- html += " <div class= \" code-block-wrapper \" style= \" position:relative; \" > "
321
+ html += " <div class= \" code-block-wrapper \" > "
322
322
323
323
// Add filename if available and enabled
324
324
if showCodeFilename, let filename = filename {
@@ -334,13 +334,13 @@ public struct HtmlRenderer: MarkupWalker {
334
334
// Generate line numbers HTML
335
335
let lineNumbersHTML = ( 1 ... lineCount) . map { " <span> \( $0) </span> " } . joined ( separator: " \n " )
336
336
337
- html += " <pre class= \" line-numbers \" style= \" display:flex; \" ><div class= \" line-numbers \" style= \" text-align:right;user-select:none;color:#888;padding-right:8px; \" > \( lineNumbersHTML) </div> "
337
+ html += " <pre class= \" line-numbers \" ><div class= \" line-numbers-container \" > \( lineNumbersHTML) </div> "
338
338
} else {
339
339
html += " <pre> "
340
340
}
341
341
342
342
// Add the code with basic syntax highlighting
343
- html += " <code class= \" language- \( language) \" style= \" flex:1; \" > "
343
+ html += " <code class= \" language- \( language) \" > "
344
344
345
345
// For now, we'll use a very simple approach to avoid HTML escaping issues
346
346
// Just display the escaped code without syntax highlighting
@@ -552,8 +552,8 @@ public struct HtmlRenderer: MarkupWalker {
552
552
/// - Returns: A tuple containing the wrapped code lines and the HTML for line numbers.
553
553
public func wrapWithLineNumbers( _ code: String ) -> ( String , String ) {
554
554
let lines = code. components ( separatedBy: . newlines)
555
- let linesHTML = lines. map { " <span> \( $0) </span> " } . joined ( separator: " \n " )
556
- let numbersHTML = ( 1 ... lines. count) . map { " <span> \( $0) </span> " } . joined ( separator: " \n " )
555
+ let linesHTML = lines. map { " <span class= \" code-line \" > \( $0) </span> " } . joined ( separator: " \n " )
556
+ let numbersHTML = ( 1 ... lines. count) . map { " <span class= \" line-number \" > \( $0) </span> " } . joined ( separator: " \n " )
557
557
return ( linesHTML, numbersHTML)
558
558
}
559
559
0 commit comments