mirror of
https://github.com/markqvist/Sideband.git
synced 2026-04-27 14:20:38 +00:00
Cleanup
This commit is contained in:
parent
bd747cadce
commit
b40e83b9b6
1 changed files with 1 additions and 12 deletions
|
|
@ -59,20 +59,9 @@ _url_pattern = re.compile(r"(https?://[^\s\]]+|www\.[^\s\]]+)")
|
|||
|
||||
|
||||
def _add_url_refs(text: str) -> str:
|
||||
"""Wrap plain URLs in Kivy [ref] markup.
|
||||
|
||||
- Supports links like:
|
||||
* http://example.com
|
||||
* https://example.com
|
||||
* www.example.com
|
||||
- If the text already contains [ref=...] markup, leave it untouched to
|
||||
avoid double-wrapping existing references.
|
||||
"""
|
||||
if "[ref=" in text:
|
||||
return text
|
||||
if "[ref=" in text: return text
|
||||
return _url_pattern.sub(r"[u][ref=\1]\1[/ref][/u]", text)
|
||||
|
||||
|
||||
class DialogItem(OneLineIconListItem):
|
||||
divider = None
|
||||
icon = StringProperty()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue