mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
ruff rule A
This commit is contained in:
@ -22,8 +22,8 @@ from mistune import InlineGrammar, InlineLexer, Markdown, Renderer, escape, esca
|
||||
|
||||
|
||||
class SithRenderer(Renderer):
|
||||
def file_link(self, id, suffix):
|
||||
return reverse("core:file_detail", kwargs={"file_id": id}) + suffix
|
||||
def file_link(self, pk, suffix):
|
||||
return reverse("core:file_detail", kwargs={"file_id": pk}) + suffix
|
||||
|
||||
def exposant(self, text):
|
||||
return """<sup>%s</sup>""" % text
|
||||
@ -158,7 +158,7 @@ class SithInlineLexer(InlineLexer):
|
||||
try: # Add file:// support for links
|
||||
file_link = re.compile(r"^file://(\d*)/?(\S*)?") # file://4000/download
|
||||
match = file_link.search(link)
|
||||
id = match.group(1)
|
||||
pk = match.group(1)
|
||||
suffix = match.group(2) or ""
|
||||
link = reverse("core:file_detail", kwargs={"file_id": id}) + suffix
|
||||
except:
|
||||
|
Reference in New Issue
Block a user