-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Improved interpreting text as markdown #6095
Conversation
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.
Is this meant to reference a different issue? #5685 is a PR.
@grzesiek2010 Could you help us a bit which parts exactly to test? The link to tests shows |
Another thing I'm not sure how should work - if I see underscore in answers in a question in Collect when I send it to Central should the underscore be interpreted in the same way? |
@grzesiek Should the underscore be interpreted in the same way when it's in the name field and the label field in a form? |
no, the value should remain unchanged as it's what we use to identify choices. Central displays the values and it's ok.
it's up to Central if styling is supported then yes. But it's not important from Collect's point of view.
The tests are here https://github.com/getodk/collect/pull/6095/files#diff-016f69200d89adf3c39980de01acc160e045b3f93c79e7745dac1c4c6f1e33f4R38
As we discussed last week everywhere we handle markdown the text should be styled:
I don't think it's important to test different sources of text that should be styled. |
We have never handled markdown in those group dialogs so the answer for now is no. I think you can file an issue for that. Apparently, it's not very important as no one has complained about it but we should be consistent and if it is possible, style the group names there too. |
There are 2 differences in examples from your tests. |
I don't think we need to do that. The repeat prompt dialog uses label text which is determined by the form designer. It's intended to be something human-readable. |
This pr is only about styling with underscores _ not with asterisks *. There might be some inconsistencies with asterisks and we are aware of that. You can file a separate issue for that. To be specific the first example The second example |
But we do support styling group names displayed in paths and it's the same group label used in both places so why not to support styling in both cases? |
Tested with Success! Verified on device with Android 14 Verified cases:
|
Tested with Success! Verified on device with Android 10 |
Closes #5508
Why is this the best possible solution? Were any other approaches considered?
We are trying to keep the way we interpret
_
markdown close to what GitHub does as this seems to be standard. I was thinking about adding a library for doing that instead of writing all those rules on our own but it looks like there is no official one that would be safe to use.How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
It introduces improvements around how we interpret _ as markdown. #5685 was closed some time ago by #5685 but recently we have realized it didn't cover all cases see: #5508 (comment). You can review tests I have updated if you need help understanding https://github.com/getodk/collect/compare/master...grzesiek2010:collect:COLLECT-5685_q?expand=1#diff-016f69200d89adf3c39980de01acc160e045b3f93c79e7745dac1c4c6f1e33f4R38.
Generally, it's only related to using underscores (_) so we can focus on testing only this case.
Do we need any specific form for testing your changes? If so, please attach one.
No.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No.
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest
(or./gradlew testLab
) and confirmed all checks still pass