Add plink tag

This commit is contained in:
2025-10-15 17:46:13 -05:00
parent e048216d11
commit 1e5167ab8b
3 changed files with 72 additions and 1 deletions

View File

@@ -1327,6 +1327,26 @@ namespace Tesses::CrossLang
}
return nullptr;
}
static TObject Net_Http_HtmlP(GCList& ls, std::vector<TObject> args)
{
std::string str;
if(GetArgument(args,0,str))
{
return HttpUtils::HtmlP(str);
}
return "";
}
static TObject Net_Http_StatusCodeString(GCList& ls, std::vector<TObject> args)
{
int64_t sc;
if(GetArgument(args,0,sc))
{
return HttpUtils::StatusCodeString((StatusCode)sc);
}
return "";
}
void TStd::RegisterNet(GC* gc, TRootEnvironment* env)
{
@@ -1337,6 +1357,8 @@ namespace Tesses::CrossLang
TDictionary* http = TDictionary::Create(ls);
TDictionary* smtp = TDictionary::Create(ls);
http->DeclareFunction(gc, "StatusCodeString", "Get the status code string",{"statusCode"},Net_Http_StatusCodeString);
http->DeclareFunction(gc, "HtmlP", "Linkify text", {"text"},Net_Http_HtmlP);
http->DeclareFunction(gc, "HtmlEncode","Html encode",{"param"}, Net_HtmlEncode);
http->DeclareFunction(gc, "UrlEncode","Url encode query param",{"param"}, Net_UrlEncode);

View File

@@ -116,13 +116,30 @@ namespace Tesses::CrossLang {
TObject Sqlite_Escape(GCList& ls, std::vector<TObject> args)
{
int64_t n;
double d;
bool b;
std::string str;
if(GetArgument(args,0,str))
{
return SQLiteDatabase::Escape(str);
}
if(GetArgument(args,0,n))
{
return std::to_string(n);
}
if(GetArgument(args,0,b))
{
return b ? "1" : "0";
}
if(GetArgument(args,0,d))
{
return std::to_string(d);
}
return Undefined();
return "NULL";
}
TObject Sqlite_Close(GCList& ls, std::vector<TObject> args)