Conversation
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
|
Visit the preview URL for this PR (updated for commit b282673): https://flutter-docs-prod--pr12900-ew-fwe-cleanup-4r555rqf.web.app |
sfshaza2
left a comment
There was a problem hiding this comment.
I know this is draft but lgtm
| bool _isVideoEmbed(Node node) { | ||
| if (node case ElementNode(tag: final tag)) { | ||
| final lowerTag = tag.toLowerCase(); | ||
| return lowerTag == 'youtubeembed' || lowerTag == 'lite-youtube'; | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| /// Finds a video embed child in a list of nodes, returns it if it's the only | ||
| /// meaningful content (ignoring whitespace text nodes) | ||
| Node? _findVideoChild(List<Node>? children) { | ||
| if (children == null) return null; | ||
|
|
||
| Node? videoChild; | ||
| for (final child in children) { | ||
| if (_isVideoEmbed(child)) { | ||
| videoChild = child; | ||
| } else if (child case TextNode(:final text)) { | ||
| // Ignore whitespace-only text nodes | ||
| if (text.trim().isNotEmpty) return null; | ||
| } else { | ||
| // Non-video, non-whitespace content found | ||
| return null; | ||
| } | ||
| } | ||
| return videoChild; | ||
| } | ||
| } |
There was a problem hiding this comment.
This was written by gemini. It feels wrong to me, but I'm not sure what the proper Jaspr way to accomplish this is.
There was a problem hiding this comment.
The problem is that it was automatically wrapping the Youtube component in a p tag, and that would require messy CSS
|
@parlough, @schultek -- I'd greatly appreciate if you can look at the code I added to tell me why its bad :) I left comments with what I think is wrong with it. Otherwise, please look at the staged site and tell me what you think about how it looks! Also, there are still some content edits I need to make before this lands. |
Refactoring to cleaner Jaspr code for #12900
Description of what this PR is changing or adding, and why:
This PR contains fixes to the remaining issues related to FWE lessons.
Issues fixed by this PR (if any):
Add quizzesMoved to separate PRPRs or commits this PR depends on (if any):
Presubmit checklist
of 80 characters or fewer.