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

Longer clues not clearing #3

Open
mizlan opened this issue Mar 1, 2022 · 6 comments
Open

Longer clues not clearing #3

mizlan opened this issue Mar 1, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@mizlan
Copy link

mizlan commented Mar 1, 2022

When a relatively long clue is displayed and followed up by a shorter one, the characters at the end are not cleared.

early clue

Screen Shot 2022-02-28 at 6 03 47 PM

moving on to a later clue

Screen Shot 2022-02-28 at 6 02 37 PM

I think this can be resolved by setting all earlier characters there to spaces, overwriting whatever was there previously.

@jpnance
Copy link
Owner

jpnance commented Mar 1, 2022

Thanks for the report! I've seen this issue before but not in a very long time, which makes me wonder if you're using an old version of xw. Unfortunately, I don't have anything like xw --version built in but just running npm install -g jpnance/xw should (I think) upgrade you to the latest version. If you tell me which puzzle you were working on when you encountered this issue, I can verify that it's fixed.

@mizlan
Copy link
Author

mizlan commented Mar 1, 2022 via email

@jpnance
Copy link
Owner

jpnance commented Mar 1, 2022

Huh, very interesting! It looks like Newsday have done a better job locking down their crosswords since I last updated the xw scraper. I assume you grabbed today's puzzle using a different scraper? If so, could you either attach it here or point me to a different puzzle that exhibits the bug?

While we're at it, which terminal emulator are you using? I've only really used xw in urxvt, xterm, and iTerm2, so it's very possible that a different terminal acts worse.

@mizlan
Copy link
Author

mizlan commented Mar 1, 2022

I think I've narrowed it down: this happens when I use xw on a local .puz file, but when I run xw lat, which presumably grabs the puz file through a different pipeline, it doesn't occur.

Maybe this will help: I use https://github.com/thisisparker/xword-dl to download puzzles (xword-dl nd downloads today's Newsday puzzle) and the bug occurs on both the Newsday and LA Times crosswords I tested.

@jpnance
Copy link
Owner

jpnance commented Mar 2, 2022

Thanks. I am now able to reproduce the bug using both a Newsday puzzle and an LA Times puzzle, though I'll have to look deeper into what's going on. xw works just fine with the various AVCX and Inkubator PUZ files I feed it so I suspect it's some sort of inconsistency with how xword-dl is implementing the PUZ format. In any case, I have something to go on now.

@jpnance
Copy link
Owner

jpnance commented Mar 4, 2022

As an update, some investigation revealed that the html2text utility (used by xword-dl) was unexpectedly emitting a newline character and that was compounded by xw never expecting to see a newline character in a clue. Parker has since updated xword-dl to account for this, so updating to the latest version should effectively solve this problem. It has, however, made me think that stripping out newline characters from clues is probably a good default behavior for xw to have, so I'll leave this issue open until I make that change.

@jpnance jpnance added the bug Something isn't working label Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants