Skip to content

Commit

Permalink
[feat] Experimental support of method assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
ftnext committed Feb 5, 2024
1 parent 999d138 commit 68531d4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sphinx_new_tab_link/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ def starttag(self, node, tagname, *args, **atts):
):
atts["target"] = "_blank"
atts["rel"] = "noopener noreferrer"
return super().starttag(node, tagname, *args, **atts)
# Support method assignment like the following (But hack)
# SomeTranslator.starttag = NewTabLinkHTMLTranslator.starttag
return super(self.__class__, self).starttag(
node, tagname, *args, **atts
)


def setup(app):
Expand Down

0 comments on commit 68531d4

Please sign in to comment.