From: Dessalines Date: Thu, 24 Feb 2022 15:31:44 +0000 (+0000) Subject: Adding nofollow to links. Fixes #542 (#543) X-Git-Url: http://these/git/readmes/%7B%60%24%7BarchiveTodayUrl%7D/%7B%7D/%22%7B%7D/%22?a=commitdiff_plain;h=6684bbeaf6df12a8725368bee30f191de285db2d;p=lemmy-ui.git Adding nofollow to links. Fixes #542 (#543) * Adding nofollow to links. Fixes #542 * Running prettier. --- diff --git a/src/shared/components/common/markdown-textarea.tsx b/src/shared/components/common/markdown-textarea.tsx index 381ecb4..af284e5 100644 --- a/src/shared/components/common/markdown-textarea.tsx +++ b/src/shared/components/common/markdown-textarea.tsx @@ -10,6 +10,7 @@ import { mdToHtml, pictrsDeleteToast, randomStr, + relTags, setupTippy, setupTribute, toast, @@ -297,7 +298,7 @@ export class MarkdownTextArea extends Component< href={markdownHelpUrl} class="btn btn-sm text-muted font-weight-bold" title={i18n.t("formatting_help")} - rel="noopener" + rel={relTags} > diff --git a/src/shared/components/common/pictrs-image.tsx b/src/shared/components/common/pictrs-image.tsx index 31e3052..4f3ddc0 100644 --- a/src/shared/components/common/pictrs-image.tsx +++ b/src/shared/components/common/pictrs-image.tsx @@ -32,8 +32,9 @@ export class PictrsImage extends Component { loading="lazy" className={classNames({ "img-fluid": !this.props.icon && !this.props.iconOverlay, - "banner": this.props.banner, - "thumbnail rounded": this.props.thumbnail && !this.props.icon && !this.props.banner, + banner: this.props.banner, + "thumbnail rounded": + this.props.thumbnail && !this.props.icon && !this.props.banner, "img-expanded slight-radius": !this.props.thumbnail && !this.props.icon, "img-blur": this.props.thumbnail && this.props.nsfw, diff --git a/src/shared/components/common/sort-select.tsx b/src/shared/components/common/sort-select.tsx index 9504756..1188064 100644 --- a/src/shared/components/common/sort-select.tsx +++ b/src/shared/components/common/sort-select.tsx @@ -1,7 +1,7 @@ import { Component, linkEvent } from "inferno"; import { SortType } from "lemmy-js-client"; import { i18n } from "../../i18next"; -import { randomStr, sortingHelpUrl } from "../../utils"; +import { randomStr, relTags, sortingHelpUrl } from "../../utils"; import { Icon } from "./icon"; interface SortSelectProps { @@ -71,7 +71,7 @@ export class SortSelect extends Component { diff --git a/src/shared/components/community/community-link.tsx b/src/shared/components/community/community-link.tsx index fee38eb..4ea7f8a 100644 --- a/src/shared/components/community/community-link.tsx +++ b/src/shared/components/community/community-link.tsx @@ -1,7 +1,7 @@ import { Component } from "inferno"; import { Link } from "inferno-router"; import { CommunitySafe } from "lemmy-js-client"; -import { hostname, showAvatars } from "../../utils"; +import { hostname, relTags, showAvatars } from "../../utils"; import { PictrsImage } from "../common/pictrs-image"; interface CommunityLinkProps { @@ -48,6 +48,7 @@ export class CommunityLink extends Component { title={apubName} className={`${this.props.muted ? "text-muted" : ""}`} href={link} + rel={relTags} > {this.avatarAndName(displayName)} diff --git a/src/shared/components/community/community.tsx b/src/shared/components/community/community.tsx index 7bc0833..da215f4 100644 --- a/src/shared/components/community/community.tsx +++ b/src/shared/components/community/community.tsx @@ -38,6 +38,7 @@ import { getPageFromProps, getSortTypeFromProps, notifyPost, + relTags, restoreScrollPosition, saveCommentRes, saveScrollPosition, @@ -370,7 +371,7 @@ export class Community extends Component { - + diff --git a/src/shared/components/home/home.tsx b/src/shared/components/home/home.tsx index 5d430a6..95c34f0 100644 --- a/src/shared/components/home/home.tsx +++ b/src/shared/components/home/home.tsx @@ -43,6 +43,7 @@ import { mdToHtml, notifyPost, numToSI, + relTags, restoreScrollPosition, saveCommentRes, saveScrollPosition, @@ -695,7 +696,7 @@ export class Home extends Component { {this.state.listingType == ListingType.All && ( <> - + @@ -703,7 +704,7 @@ export class Home extends Component { )} {this.state.listingType == ListingType.Local && ( <> - + @@ -712,7 +713,7 @@ export class Home extends Component { {UserService.Instance.myUserInfo && this.state.listingType == ListingType.Subscribed && ( <> - + {