From 394192bdaf6bc285be8258ead6553c3cb4054d2f Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 13 May 2015 19:20:53 +0200 Subject: [PATCH 1/2] InfoDump: Added support for links. Also fixed processing of lists and list items. --- MCServer/Plugins/InfoDump.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/MCServer/Plugins/InfoDump.lua b/MCServer/Plugins/InfoDump.lua index ab4dfd861..433827ce7 100644 --- a/MCServer/Plugins/InfoDump.lua +++ b/MCServer/Plugins/InfoDump.lua @@ -65,8 +65,12 @@ local function ForumizeString(a_Str) a_Str = a_Str:gsub("{%%p}", "\n\n") a_Str = a_Str:gsub("{%%b}", "[b]"):gsub("{%%/b}", "[/b]") a_Str = a_Str:gsub("{%%i}", "[i]"):gsub("{%%/i}", "[/i]") - a_Str = a_Str:gsub("{%%list}", "[list]"):gsub("{%%/list}", "[/list]") - a_Str = a_Str:gsub("{%%li}", "[*]"):gsub("{%%/li}", "") + a_Str = a_Str:gsub("{%%list}", "\n[list]"):gsub("{%%/list}", "[/list]") + a_Str = a_Str:gsub("{%%li}", "\n[*]"):gsub("{%%/li}", "\n") + + -- Process links: {%a LinkDestination}LinkText{%/a} + a_Str = a_Str:gsub("{%%a%s([^}]*)}([^{]*){%%/a}", "[url=%1]%2[/url]") + -- TODO: Other formatting return a_Str @@ -106,8 +110,12 @@ local function GithubizeString(a_Str) a_Str = a_Str:gsub("{%%p}", "\n\n") a_Str = a_Str:gsub("{%%b}", "**"):gsub("{%%/b}", "**") a_Str = a_Str:gsub("{%%i}", "*"):gsub("{%%/i}", "*") - a_Str = a_Str:gsub("{%%list}", ""):gsub("{%%/list}", "") - a_Str = a_Str:gsub("{%%li}", " - "):gsub("{%%/li}", "") + a_Str = a_Str:gsub("{%%list}", "\n"):gsub("{%%/list}", "\n") + a_Str = a_Str:gsub("{%%li}", "\n - "):gsub("{%%/li}", "") + + -- Process links: {%a LinkDestination}LinkText{%/a} + a_Str = a_Str:gsub("{%%a%s([^}]*)}([^{]*){%%/a}", "[%2](%1)") + -- TODO: Other formatting return a_Str From b34fd9c6d9a65987f3e0f55f33ddb03a89d8853f Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 13 May 2015 19:24:57 +0200 Subject: [PATCH 2/2] InfoDump: Added DownloadLocation to forum post generator. --- MCServer/Plugins/InfoDump.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MCServer/Plugins/InfoDump.lua b/MCServer/Plugins/InfoDump.lua index 433827ce7..a715c9a18 100644 --- a/MCServer/Plugins/InfoDump.lua +++ b/MCServer/Plugins/InfoDump.lua @@ -600,7 +600,10 @@ local function DumpPluginInfoForum(a_PluginFolder, a_PluginInfo) DumpCommandsForum(a_PluginInfo, f) DumpPermissionsForum(a_PluginInfo, f) if (a_PluginInfo.SourceLocation ~= nil) then - f:write("[b][color=blue]Source:[/color] [url=", a_PluginInfo.SourceLocation, "]Link[/url][/b]") + f:write("\n[b]Source[/b]: ", a_PluginInfo.SourceLocation, "\n") + end + if (a_PluginInfo.DownloadLocation ~= nil) then + f:write("[b]Download[/b]: ", a_PluginInfo.DownloadLocation) end f:close() return true