feat: support <details> tag for GithubHtmlView (#528)#819
feat: support <details> tag for GithubHtmlView (#528)#819housseindjirdeh merged 6 commits intogitpoint:masterfrom
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! |
lex111
left a comment
There was a problem hiding this comment.
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!
chinesedfan
left a comment
There was a problem hiding this comment.
@whitedogg13 Great attempt. Maybe you can check #609 to get some inspirations. For example,
- enhance
toggle-view.component.jsto replaceWithToggle - handle the
summarytag - 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! |
chinesedfan
left a comment
There was a problem hiding this comment.
@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 xxxorshould 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 :) |
housseindjirdeh
left a comment
There was a problem hiding this comment.
So amazing, thank you so much for this @whitedogg13 ⭐️
| {this.props.TouchableView} | ||
| {this.props.renderTouchable | ||
| ? this.props.renderTouchable(this.state.collapsed) | ||
| : this.props.TouchableView} |
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!