Skip to content

Commit 9f91ed5

Browse files
anjiazhuyouxing田丰
and
田丰
authoredMar 25, 2025··
fix: Fix the problem of long text folding when JsonViewer does not enable automatic line wrapping. (#2756)
* fix: resolve line number display issue in JsonViewer under Tooltip * fix: resolve long text folding issue --------- Co-authored-by: 田丰 <[email protected]>
1 parent 43b5920 commit 9f91ed5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
 

‎packages/semi-foundation/jsonViewer/jsonViewer.scss

+2
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ $module: #{$prefix}-json-viewer;
8383
text-align: center;
8484
width: 50px;
8585
user-select: none;
86+
word-wrap: normal !important;
87+
overflow-wrap: normal !important;
8688
}
8789

8890
&-content-container {

‎packages/semi-json-viewer-core/src/view/view.ts

+3
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,9 @@ export class View {
418418
const span = document.createElement('span');
419419
span.className = token.scopes;
420420
span.textContent = content;
421+
if (!this._options?.autoWrap) {
422+
span.style.whiteSpace = 'pre';
423+
}
421424
container.appendChild(span);
422425
}
423426

0 commit comments

Comments
 (0)
Please sign in to comment.