Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite Recursion in Word Wrapping for Long Continuous Words #47

Open
Yogesh0627 opened this issue Sep 1, 2024 · 0 comments
Open

Infinite Recursion in Word Wrapping for Long Continuous Words #47

Yogesh0627 opened this issue Sep 1, 2024 · 0 comments
Labels
acknowledged Acknowledged

Comments

@Yogesh0627
Copy link

Describe the bug

There is a bug in the library related to handling long continuous words that do not contain spaces. When a user types or inputs a continuous word that exceeds the width of the page, the library enters an infinite recursion loop while attempting to fit the content onto the next page. This occurs because the word does not break or wrap properly, causing the library to repeatedly attempt to fit the overflowing content onto subsequent pages.

To Reproduce

  1. Type or Input a Long Continuous Word: Enter a very long word or string without any spaces, exceeding the width of the page or container.

  2. Observe Crash as there are no consoles at this stage so you can't check for inspect: As the content overflows the current page, the library attempts to fit the word onto the next page. Since the word still does not fit, the library continues this process recursively.

  3. Infinite Recursion: The process continues indefinitely as the library is unable to handle the overflow properly, leading to an infinite recursion loop.

Expected behavior

Word Wrapping or Breaking: The library should handle long continuous words gracefully by either breaking the word into smaller parts or applying some form of word wrapping.

Prevent Infinite Recursion: The library should avoid entering an infinite loop and should instead handle the overflow by providing a clear indication or solution, such as a horizontal scrollbar or text overflow handling mechanism.

Infinite Recursion Loop: The library fails to manage the overflow of long continuous words, resulting in an infinite recursion loop as it continuously attempts to fit the word onto the next page, which is also unable to accommodate the word.

Actual Behavior

Infinite Recursion Loop: The library fails to manage the overflow of long continuous words, resulting in an infinite recursion loop as it continuously attempts to fit the word onto the next page, which is also unable to accommodate the word.

Impact

Rendering Issues: Users experience rendering issues when long words are entered, making it impossible to view or interact with the content properly.
Performance Problems: The infinite recursion can lead to performance problems, such as excessive CPU usage and potential crashes.

Proposed Solution
Implement Word Breaking: Introduce logic to break long continuous words into smaller chunks that can fit within the page width.
Word Wrapping: Implement word wrapping techniques to handle long words that exceed the page width.
Error Handling: Add error handling to detect and manage cases where content overflow cannot be resolved through normal means, such as providing an option to scroll horizontally or adjust the layout.

@motla motla added the acknowledged Acknowledged label Sep 1, 2024
Yogesh0627 pushed a commit to Yogesh0627/vue-document-editor that referenced this issue Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged Acknowledged
Projects
None yet
Development

No branches or pull requests

2 participants