-
-
Notifications
You must be signed in to change notification settings - Fork 5
SF-3553 Fix lynx start-of-verse auto-correct issue #3450
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3450 +/- ##
==========================================
- Coverage 82.20% 82.19% -0.01%
==========================================
Files 611 611
Lines 36433 36449 +16
Branches 5980 5984 +4
==========================================
+ Hits 29951 29961 +10
- Misses 5621 5627 +6
Partials 861 861 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code and the reasoning look good, but I am not able to get the punctuation to automatically be corrected. I type the sentence
“It’s not that I"m so smart, it"s just that I stay with problems longer.'
But the auto-correct doesn't work. Am I doing something wrong? I have the lynx auto-correct enabled.
@RaymondLuong3 reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @siltomato)
src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/lynx/insights/lynx-workspace.service.ts
line 207 at r1 (raw file):
// 'offset' may be stale here. For example, a blank embed may have been auto-deleted while awaiting the doc. // Check if a newer call has superseded this one while we were awaiting the document.
Thanks for the helpful comments!
Code quote:
// 'offset' may be stale here. For example, a blank embed may have been auto-deleted while awaiting the doc.
// Check if a newer call has superseded this one while we were awaiting the document.
7868c6a
to
6887af2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you getting any auto conversion to smart quotes? Single quotes do not always convert due to the current rules for detecting apostrophes. There is is an open issue for improving single quotes in the lynx lib repo. The double quotes, however, should convert. Is there a book/chapter/verse on Stp22 project that you can reproduce this?
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @siltomato)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the problem. It was because I had not embeds in my chapter. I can see the double quotes being converted now.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @siltomato)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, hold on, when I am typing single quotes, the first gets the opening quote, but the ending quote remains a straight quote.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @siltomato)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is an issue. It is somewhat by design, but perhaps the rules could be improved. I have tracked it in the lynx lib repo: sillsdev/lynx#47
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @siltomato)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. Since that is a known behaviour, I'll go ahead and move this to testing.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @siltomato)
This PR fixes an issue where the
offset
for the insert that is passed to the lynx library for potential smart-quote swap detection was incorrect due to a blank embed being removed when starting a quote at the start of a verse.The solution involves adding a call sequence count to detect possible changes that may have occurred during
await
. If the sequence count changed, the call is aborted, as the subsequent call willdelta.compose()
with the aborted call's delta, and the offset will be recalculated from the resulting delta.This PR doesn't address the unmatched single-quote issue, as that behavior may be by design (or could be improved in lynx library).
This change is