mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #234] Escaping in the TextView seems faulty #180
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#180
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Bios-Marcel on GitHub (Feb 5, 2019).
Original GitHub issue: https://github.com/rivo/tview/issues/234
Hey,
I am currently writing a chat application, that means the textview can get filled with arbitrary text.
I just had a user write a small snippet of code:
It was basically a line of code with markdown around it. After calling
tview.Escape, it renders the text like this:I assume this is a bug, or did I missunderstand
tview.Escape?@Bios-Marcel commented on GitHub (Feb 7, 2019):
Can be reproduced using this:
It works fine when either
RegionsorDynamicColorsare set tofalse, however, when both aretrueit causes problems.I think this could be added as a recursion unit test after fixing this:
@rivo commented on GitHub (Feb 13, 2019):
Thank you for catching this. I believe I fixed this with the latest commit. Let me know in case you still find anything here.
@Bios-Marcel commented on GitHub (Feb 13, 2019):
Cool, seems to be working fine. Anyhow, what do you think about regression tests? I think it'd be cool to prevent such bugs from happening again. Stuff like parsing logic and such is always quite fragile in my opinion.
@rivo commented on GitHub (Feb 13, 2019):
Yeah, it's on my list. What I would like to have in there is a test stub for
tcell.Screenwhose character buffer could then be checked against in the test cases. So it wouldn't just be parsing logic but also layouts and user input behaviour that could be tested this way.Haven't had time for this yet, though.