Git Product home page Git Product logo

Comments (1)

micahellison avatar micahellison commented on May 24, 2024

Hi @wangchang327, thanks for filing this, and for the detailed example.

We use rich to handle line wrapping, and I think you'll have better luck reporting this issue there rather than having someone trying to make an exception in jrnl. The wrapping behavior is consistent (it always wraps on spaces when spaces exist), but maybe they'll have a solution.

I did at least confirm that it is an issue with rich independent of jrnl. I'm sharing my test script here in case that helps:

from rich.console import Console
from rich.text import Text

mixed_string = """
鑑於對人類家庭所有some English words成員的固有尊嚴some English words及其平等的和不移的權some English words利的承認,乃是世界自由、正義與和平的基礎
人類社会のすべての構成員の固有のsome English words尊厳と平等で譲ることのできない権利とをsome English words承認することは

人人生而自由,在尊嚴和權利上一律平等。他們賦有理性和良心,並應以兄弟關係的精神相對待。人人有資格享受本宣言所載的一切權利和自由,不分種族、膚色、性別、語言、宗教、政治或其他見解、國籍或社會出身、財產、出生或其他身分等任何區別。"
"""

richtext = Text.from_ansi(mixed_string, no_wrap=False, tab_size=None)

console = Console(width=80, force_terminal=True)
with console.capture() as capture:
    console.print(richtext, sep="", end="")
print(capture.get())

Otherwise, I'm closing this as won't fix, but if you do choose to file an issue with rich, feel free to link back to this.

from jrnl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.