Update app.py
Browse files
app.py
CHANGED
|
@@ -456,20 +456,22 @@ with gr.Blocks() as demo: # Use blocks to add javascript styling
|
|
| 456 |
"""
|
| 457 |
)
|
| 458 |
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
}
|
| 472 |
""")
|
|
|
|
|
|
|
|
|
|
| 473 |
|
| 474 |
|
| 475 |
# Launch the interface
|
|
|
|
| 456 |
"""
|
| 457 |
)
|
| 458 |
|
| 459 |
+
# CSS 스타일링 추가
|
| 460 |
+
demo.load(js="""
|
| 461 |
+
() => {
|
| 462 |
+
const style = document.createElement('style');
|
| 463 |
+
style.textContent = `
|
| 464 |
+
.chatbot-wrapper .message {
|
| 465 |
+
white-space: pre-wrap; /* 채팅 메시지 내의 줄바꿈 유지 */
|
| 466 |
+
word-wrap: break-word; /* 긴 단어가 영역을 벗어날 경우 자동 줄바꿈 */
|
| 467 |
+
}
|
| 468 |
+
`;
|
| 469 |
+
document.head.appendChild(style);
|
| 470 |
+
}
|
|
|
|
| 471 |
""")
|
| 472 |
+
|
| 473 |
+
|
| 474 |
+
|
| 475 |
|
| 476 |
|
| 477 |
# Launch the interface
|