Apply prettier formatting
This commit is contained in:
@@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
import ReactDOM from 'react-dom';
|
||||
import ReactDOM from "react-dom";
|
||||
|
||||
import PlatformPeg from "../PlatformPeg";
|
||||
import LinkWithTooltip from "../components/views/elements/LinkWithTooltip";
|
||||
@@ -44,8 +44,10 @@ export function tooltipifyLinks(rootNodes: ArrayLike<Element>, ignoredNodes: Ele
|
||||
continue;
|
||||
}
|
||||
|
||||
if (node.tagName === "A" && node.getAttribute("href")
|
||||
&& node.getAttribute("href") !== node.textContent.trim()
|
||||
if (
|
||||
node.tagName === "A" &&
|
||||
node.getAttribute("href") &&
|
||||
node.getAttribute("href") !== node.textContent.trim()
|
||||
) {
|
||||
let href = node.getAttribute("href");
|
||||
try {
|
||||
@@ -57,9 +59,11 @@ export function tooltipifyLinks(rootNodes: ArrayLike<Element>, ignoredNodes: Ele
|
||||
// The node's innerHTML was already sanitized before being rendered in the first place, here we are just
|
||||
// wrapping the link with the LinkWithTooltip component, keeping the same children. Ideally we'd do this
|
||||
// without the superfluous span but this is not something React trivially supports at this time.
|
||||
const tooltip = <LinkWithTooltip tooltip={href}>
|
||||
<span dangerouslySetInnerHTML={{ __html: node.innerHTML }} />
|
||||
</LinkWithTooltip>;
|
||||
const tooltip = (
|
||||
<LinkWithTooltip tooltip={href}>
|
||||
<span dangerouslySetInnerHTML={{ __html: node.innerHTML }} />
|
||||
</LinkWithTooltip>
|
||||
);
|
||||
|
||||
ReactDOM.render(tooltip, node);
|
||||
containers.push(node);
|
||||
|
||||
Reference in New Issue
Block a user