-
Notifications
You must be signed in to change notification settings - Fork 580
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
Match punctuation for code card descriptions #10221
Conversation
Co-authored-by: Sarah Rietkerk <[email protected]>
@@ -100,7 +100,13 @@ export function renderCodeCard(card: pxt.CodeCard, options: CodeCardRenderOption | |||
} | |||
if (card.description) { | |||
const descr = div(ct, 'ui description'); | |||
const shortenedDescription = card.description.split('.')[0] + '.'; | |||
const regex = /((?:\.{1,3})|[\!\?…])/; |
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.
This is a nice improvement, also somewhat English-centric. Are there additional characters we should consider here to support all languages?
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.
(totally fine to defer additional character support if it isn't straight forward)
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'll look at the languages we support in the editor and see what else needs to be added.
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.
Yea I wasn't able to find a collection of end-of-sentence punctuation for all languages. This would require going through each language one by one. I'm going to defer this work for now.
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.
if we are concerned about this, we could always only enable this behavior for languages we know it works for and then just use css text-overflow for the rest
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.
@riknoll How would I do that?
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.
This is a good improvement and fixes the most glaring cases. Multi-language concerns can we addressed separately, if they're an actual concern.
Thanks to @riknoll for all the help.
Fixes https://github.com/microsoft/pxt-minecraft/issues/2508