This is an automated email from the ASF dual-hosted git repository.
kentontaylor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git
The following commit(s) were added to refs/heads/master by this push:
new abfce80 [#8420] added nofollow to links generated by Markdown syntax
and side menu in wiki
abfce80 is described below
commit abfce801255df118bd8c1f74b7c24fc981ee5090
Author: Guillermo Cruz <[email protected]>
AuthorDate: Fri Mar 18 11:31:56 2022 -0600
[#8420] added nofollow to links generated by Markdown syntax and side menu
in wiki
---
Allura/allura/lib/markdown_extensions.py | 2 ++
ForgeWiki/forgewiki/wiki_main.py | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Allura/allura/lib/markdown_extensions.py
b/Allura/allura/lib/markdown_extensions.py
index e576db4..b929a6b 100644
--- a/Allura/allura/lib/markdown_extensions.py
+++ b/Allura/allura/lib/markdown_extensions.py
@@ -488,6 +488,8 @@ class
RelativeLinkRewriter(markdown.postprocessors.Postprocessor):
# just make sure no spaces
val = val.replace(' ', '%20')
tag[attr] = val
+ if 'markdown_syntax' in val:
+ tag['rel'] = 'nofollow'
if '://' in val:
if is_nofollow_url(val):
tag['rel'] = 'nofollow'
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index 67e9edc..180d3ea 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -276,7 +276,8 @@ The wiki uses [Markdown](%s) syntax.
links.append(SitemapEntry(subscribe_title, subscribe_url,
ui_icon=g.icons['mail']))
if not admin_menu:
links += [SitemapEntry(''),
- SitemapEntry('Formatting Help', '/nf/markdown_syntax',
extra_html_attrs={'target': '_blank'})]
+ SitemapEntry('Formatting Help', '/nf/markdown_syntax',
+ extra_html_attrs={'target': '_blank',
'rel': 'nofollow'})]
return links
def admin_menu(self, skip_common_menu=False):
@@ -287,7 +288,6 @@ The wiki uses [Markdown](%s) syntax.
if not self.show_left_bar and not skip_common_menu:
links += self.create_common_wiki_menu(has_create_access=True,
admin_menu=True)
links += super().admin_menu(force_options=True)
-
return links
@h.exceptionless([], log)