Skip to content

Commit aa0dcd9

Browse files
brondsemwebjunkie01
authored andcommitted
[#8597] minor cleanup
1 parent 8030c58 commit aa0dcd9

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

Allura/allura/lib/markdown_extensions.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def extendMarkdown(self, md):
309309

310310
class EmojiInlinePattern(markdown.inlinepatterns.InlineProcessor):
311311

312-
def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | None, int | None, int | None]:
312+
def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | str | None, int | None, int | None]:
313313
emoji_code = m.group(1)
314314
return emoji.emojize(emoji_code, language="alias"), m.start(0), m.end(0)
315315

@@ -325,7 +325,7 @@ def extendMarkdown(self, md):
325325

326326
class UserMentionInlinePattern(markdown.inlinepatterns.InlineProcessor):
327327

328-
def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | None, int | None, int | None]:
328+
def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | str | None, int | None, int | None]:
329329
user_name = m.group(1).replace("@", "")
330330
user = M.User.by_username(user_name)
331331
result = None
@@ -429,15 +429,18 @@ def __init__(self, *args, **kwargs):
429429
self.macro = macro.parse(self.ext._macro_context)
430430
super().__init__(*args, **kwargs)
431431

432-
def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | None, int | None, int | None]:
432+
def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | str | None, int | None, int | None]:
433433
html = self.macro(m.group(1))
434434
placeholder = self.md.htmlStash.store(html)
435435
return placeholder, m.start(0), m.end(0)
436436

437437

438438
class ForgeLinkTreeProcessor(markdown.treeprocessors.Treeprocessor):
439+
'''
440+
Wraps artifact links with [] and tracks those artifact links for search.find_shortlinks
439441
440-
'''Wraps artifact links with []'''
442+
The 'alink' class itself is not currently needed for any JS/CSS but ends up in HTML anyway
443+
'''
441444

442445
def __init__(self, parent):
443446
self.parent = parent
@@ -544,7 +547,7 @@ def run(self, text):
544547

545548
class AutolinkPattern(markdown.inlinepatterns.InlineProcessor):
546549

547-
def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | None, int | None, int | None]:
550+
def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | str | None, int | None, int | None]:
548551
old_link = m.group(1)
549552
result = etree.Element('a')
550553
result.text = old_link

ForgeWiki/forgewiki/wiki_main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ def default_root_page_text(self):
169169
170170
This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
171171
172-
The wiki uses [Markdown](%s) syntax.
172+
The wiki uses [Markdown](/nf/markdown_syntax) syntax.
173173
174174
[[members limit=20]]
175-
""" % (self.url + 'markdown_syntax/')
175+
"""
176176

177177
@property
178178
def show_discussion(self):

0 commit comments

Comments
 (0)