File tree 1 file changed +19
-9
lines changed
1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -22,20 +22,30 @@ enum Gesture {
22
22
TAP ,
23
23
}
24
24
25
- InteractableElement parseInteractableElement (
25
+ StyledElement parseInteractableElement (
26
26
dom.Element element, List <StyledElement > children) {
27
27
switch (element.localName) {
28
28
case "a" :
29
- return InteractableElement (
29
+ if (element.attributes.containsKey ('href' )) {
30
+ return InteractableElement (
31
+ name: element.localName! ,
32
+ children: children,
33
+ href: element.attributes['href' ],
34
+ style: Style (
35
+ color: Colors .blue,
36
+ textDecoration: TextDecoration .underline,
37
+ ),
38
+ node: element,
39
+ elementId: element.id
40
+ );
41
+ }
42
+ // When <a> tag have no href, it must be non clickable and without decoration.
43
+ return StyledElement (
30
44
name: element.localName! ,
31
45
children: children,
32
- href: element.attributes['href' ],
33
- style: Style (
34
- color: Colors .blue,
35
- textDecoration: TextDecoration .underline,
36
- ),
46
+ style: Style (),
37
47
node: element,
38
- elementId: element.id
48
+ elementId: element.id,
39
49
);
40
50
/// will never be called, just to suppress missing return warning
41
51
default :
@@ -48,4 +58,4 @@ InteractableElement parseInteractableElement(
48
58
elementId: "[[No ID]]"
49
59
);
50
60
}
51
- }
61
+ }
You can’t perform that action at this time.
0 commit comments