|
75 | 75 | <Name>HLineBy</Name> |
76 | 76 | <ReferencedMemberName>HorizontalLine</ReferencedMemberName> |
77 | 77 | </AliasProperty> |
| 78 | + <AliasProperty> |
| 79 | + <Name>Href</Name> |
| 80 | + <ReferencedMemberName>Link</ReferencedMemberName> |
| 81 | + </AliasProperty> |
78 | 82 | <AliasProperty> |
79 | 83 | <Name>l</Name> |
80 | 84 | <ReferencedMemberName>Step</ReferencedMemberName> |
@@ -3925,6 +3929,43 @@ if ($chromeOutput -match '<img\ssrc="data:image/\w+;base64,(?<b64>[^"]+ |
3925 | 3929 |
|
3926 | 3930 | </GetScriptBlock> |
3927 | 3931 | </ScriptProperty> |
| 3932 | + <ScriptProperty> |
| 3933 | + <Name>Link</Name> |
| 3934 | + <GetScriptBlock> |
| 3935 | + <# |
| 3936 | +.SYNOPSIS |
| 3937 | + Gets a Turtle's link |
| 3938 | +.DESCRIPTION |
| 3939 | + Gets a link reference (href) associated with the turtle. |
| 3940 | + |
| 3941 | + If one is present, this will nest the turtle inside of an <a> element |
| 3942 | +.EXAMPLE |
| 3943 | + turtle link https://psturtle.com/ link |
| 3944 | + |
| 3945 | +#> |
| 3946 | +$this.'.link' |
| 3947 | + |
| 3948 | + </GetScriptBlock> |
| 3949 | + <SetScriptBlock> |
| 3950 | + <# |
| 3951 | +.SYNOPSIS |
| 3952 | + Sets a Turtle's link |
| 3953 | +.DESCRIPTION |
| 3954 | + Sets a link reference (`href`) associated with the turtle. |
| 3955 | + |
| 3956 | + If one is present, this will nest the turtle inside of an anchor `<a>` element |
| 3957 | +.EXAMPLE |
| 3958 | + turtle link https://psturtle.com/ |
| 3959 | +#> |
| 3960 | +param( |
| 3961 | +[string] |
| 3962 | +$Link |
| 3963 | +) |
| 3964 | + |
| 3965 | +$this | Add-Member NoteProperty '.Link' $link -Force |
| 3966 | + |
| 3967 | + </SetScriptBlock> |
| 3968 | + </ScriptProperty> |
3928 | 3969 | <ScriptProperty> |
3929 | 3970 | <Name>Mask</Name> |
3930 | 3971 | <GetScriptBlock> |
@@ -4613,14 +4654,19 @@ foreach ($key in $this.SVGAttribute.Keys) { |
4613 | 4654 |
|
4614 | 4655 | "<svg $(@(foreach ($attributeName in $svgAttributes.Keys) { |
4615 | 4656 | " $attributeName='$($svgAttributes[$attributeName])'" |
4616 | | -}) -join '')>" |
| 4657 | +}) -join '')>" |
4617 | 4658 | # Declare any SVG animations |
4618 | 4659 | if ($this.SVGAnimation) {$this.SVGAnimation} |
4619 | | - |
| 4660 | + if ($this.Link) { |
| 4661 | + "<a href='$($this.Link)'>" |
| 4662 | + } |
4620 | 4663 | # Output our own path |
4621 | 4664 | $this.PathElement.OuterXml |
4622 | 4665 | # Followed by any text elements |
4623 | 4666 | $this.TextElement.OuterXml |
| 4667 | + if ($this.Link) { |
| 4668 | + "</a>" |
| 4669 | + } |
4624 | 4670 |
|
4625 | 4671 | # If the turtle has children |
4626 | 4672 | $children = @(foreach ($turtleName in $this.Turtles.Keys) { |
|
0 commit comments