Skip to content

Commit c842e28

Browse files
committed
fix: line break in code block
1 parent 084f090 commit c842e28

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<script setup lang="ts">
1616
import { CodeBlock } from './components/code-block';
1717
const code = `print("Hello, World!")
18-
s = 2
18+
s = "lorem ipsum dolor sit amet consect etur adipiscing elit"
1919
def add(a, b):
2020
const ant = 1
2121
`;

src/components/code-block/CodeBlock.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,16 @@
134134
135135
.vuejs-code-block pre .line {
136136
padding: 0 1rem;
137-
138137
display: flex;
139-
align-items: center;
138+
align-items: start;
140139
font-size: 1rem;
141140
}
142141
142+
.vuejs-code-block pre .line span {
143+
white-space: pre-wrap;
144+
word-break: break-word;
145+
}
146+
143147
.vuejs-code-block pre .line-number {
144148
color: #888;
145149
user-select: none;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy