fix: Remove circular depends
All checks were successful
Build Docker / Build Image (push) Successful in 47s

This commit is contained in:
2025-05-24 15:40:03 +10:00
parent 9a8472c5cb
commit fdffa5bd31

View File

@@ -3,7 +3,6 @@ import json
import urllib.parse
from flask import render_template
from domainLookup import punycode_to_emoji
from main import renderDomain
import os
# Get Explorer URL
@@ -349,4 +348,21 @@ def plugin_output_dash(outputs, returns):
if outputs[returnOutput] == None:
continue
html += render_template('components/dashboard-plugin.html', name=returns[returnOutput]["name"], output=outputs[returnOutput])
return html
return html
def renderDomain(name: str) -> str:
"""
Render a domain name with emojis and other special characters.
"""
# Convert emoji to punycode
try:
rendered = name.encode("ascii").decode("idna")
if rendered == name:
return f"{name}/"
return f"{rendered}/ ({name})"
except Exception as e:
return f"{name}/"