// Copyright 2017-2022 The MathJax Consortium// SPDX-License-Identifier: Apache-2.0// This file is a Go translation and modification of MathJax 3.2.2.package svgimport// linkParent ports SVGWrapper.createSVGnode's href path. MathJax wraps the// node in an SVG anchor and installs a transparent hit box as the first child// of the linked group so the entire measured box remains clickable.func ( *wrapper) (, *Element) *Element {if .node == nil || .node.Attributes == nil {return } , := .node.Attributes.Get("href")if ! || fmt.Sprint() == "" {return } := NewElement("a").SetAttr("href", fmt.Sprint()) .Append() := .outerBBox() .Append(NewElement("rect").SetAttr("data-hitbox", "true").SetAttr("fill", "none").SetAttr("stroke", "none").SetAttr("pointer-events", "all").SetAttr("width", fixed(.W)).SetAttr("height", fixed(.H+.D)).SetAttr("y", fixed(-.D)))return}
The pages are generated with Goldsv0.8.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.