-
Notifications
You must be signed in to change notification settings - Fork 783
feat: support <details> tag for GithubHtmlView (#528) #819
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
feat: support <details> tag for GithubHtmlView (#528) #819
Conversation
@whitedogg13 it's awesome! 👏 What do you think can write a small test for this component? |
@lex111 Sure, love to do so. I will update it later. |
Hi @lex111 , I have just added test cases to test this PR. Please feel free to feedback! BTW, in this case I use
Thanks! |
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 good for me, but I would like to hear the opinions of other members, so for now I will not merge PR. Thanks!
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.
@whitedogg13 Great attempt. Maybe you can check #609 to get some inspirations. For example,
- enhance
toggle-view.component.js
to replaceWithToggle
- handle the
summary
tag - add different edge cases to tests
Hi @chinesedfan , thanks for the review! I made some enhancement over your first and third suggestions:
It's always good to test and reuse code. However, about the handling for
Because of above reasons, I think current version makes more sense to me. Thanks! |
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.
@whitedogg13 I tested in iOS simulator to visit #528 and #609. It worked very well. Good job!
Forgive my little OCD to mention 2 other things.
- Current test files are named as component names.
- If descriptions of test cases are well-written, you can remove those inner comments. Keeping them in the same format like
do blabla when xxx
orshould xxx if/when xx
.
@chinesedfan Thanks for suggestions, I will update it later :) |
Hi @chinesedfan , I have pushed the changes, thanks! |
@machour hi, can we merge this PR? |
Hey @lex111, sorry I've been away from computer these days. Have this PR been tested on Android? If it's working there too then you have my blessing :) |
@machour I currently have no opportunity to check, maybe you have? |
Hi @lex111 I have just tested this on Nexus 5 using Genymotion Emulator, and it works correctly. For further PR, I will test it in Android as well :) |
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.
So amazing, thank you so much for this @whitedogg13 ⭐️
{this.props.TouchableView} | ||
{this.props.renderTouchable | ||
? this.props.renderTouchable(this.state.collapsed) | ||
: this.props.TouchableView} |
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.
👏
Screenshots
Before (not support details tag)

After 1 (detail not expanded)

After 2 (detail expanded)

Description
Support
<details>
tag inGithubHtmlView
, as mentioned in #528 .First try to find
<summary>
tag inside<details>
, then render a toggle-able view if found, otherwise do a rollback rendering. Also try to prettify the text in<summary>
if we got only one text child inside it.Thanks!