mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Update auto-url parser for main and github:discussion tokens
This commit is contained in:
parent
3d05932156
commit
8f7df092b3
2 changed files with 10 additions and 5 deletions
|
|
@ -5,18 +5,18 @@ Jan 7, 2023
|
|||
|
||||
- Stop new registrations with `settings.NEW_ACCOUNT_REGISTRATION_ENABLED`
|
||||
(inspectorcaracal)
|
||||
- Bug fixes
|
||||
- Bug fixes.
|
||||
|
||||
## Evennia 1.0.2
|
||||
Dec 21, 2022
|
||||
|
||||
Bug fix release. Fix more issues with discord bot reconnecting. Some doc
|
||||
- Bug fix release. Fix more issues with discord bot reconnecting. Some doc
|
||||
updates.
|
||||
|
||||
## Evennia 1.0.1
|
||||
Dec 7, 2022
|
||||
|
||||
Bug fix release. Main issue was reconnect bug for discord bot.
|
||||
- Bug fix release. Main issue was reconnect bug for discord bot.
|
||||
|
||||
## Evennia 1.0.0
|
||||
|
||||
|
|
|
|||
|
|
@ -157,10 +157,13 @@ _githubstart = "github:"
|
|||
_apistart = "api:"
|
||||
_choose_issue = "github:issue"
|
||||
_sourcestart = "src:"
|
||||
_discussions = "github:discussions"
|
||||
# remaps
|
||||
_github_code_root = "https://github.com/evennia/evennia/blob/"
|
||||
_github_doc_root = "https://github.com/evennia/tree/master/docs/sources/"
|
||||
_github_issue_choose = "https://github.com/evennia/evennia/issues/new/choose"
|
||||
_github_discussions = "https://github.com/evennia/evennia/discussions"
|
||||
|
||||
_ref_regex = re.compile( # normal reference-links [txt](url)
|
||||
r"\[(?P<txt>[\w -\[\]\`\n]+?)\]\((?P<url>.+?)\)", re.I + re.S + re.U + re.M
|
||||
)
|
||||
|
|
@ -194,11 +197,13 @@ def url_resolver(app, docname, source):
|
|||
if url.endswith(_choose_issue):
|
||||
# github:issue shortcut
|
||||
return _github_issue_choose
|
||||
elif url.endswith(_discussions):
|
||||
return _github_discussions
|
||||
elif _githubstart in url:
|
||||
# github:develop/... shortcut
|
||||
urlpath = url[url.index(_githubstart) + len(_githubstart) :]
|
||||
if not (urlpath.startswith("develop/") or urlpath.startswith("master")):
|
||||
urlpath = "master/" + urlpath
|
||||
if not (urlpath.startswith("develop/") or urlpath.startswith("main/")):
|
||||
urlpath = "main/" + urlpath
|
||||
return _github_code_root + urlpath
|
||||
elif _sourcestart in url:
|
||||
ind = url.index(_sourcestart)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue