summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-05-13 19:20:53 +0200
committerMattes D <github@xoft.cz>2015-05-13 19:20:53 +0200
commit394192bdaf6bc285be8258ead6553c3cb4054d2f (patch)
tree598037186f2ec87159c653d3e9a29a49cdaae74d
parentMerge pull request #2001 from mc-server/BindingsCleanup (diff)
downloadcuberite-394192bdaf6bc285be8258ead6553c3cb4054d2f.tar
cuberite-394192bdaf6bc285be8258ead6553c3cb4054d2f.tar.gz
cuberite-394192bdaf6bc285be8258ead6553c3cb4054d2f.tar.bz2
cuberite-394192bdaf6bc285be8258ead6553c3cb4054d2f.tar.lz
cuberite-394192bdaf6bc285be8258ead6553c3cb4054d2f.tar.xz
cuberite-394192bdaf6bc285be8258ead6553c3cb4054d2f.tar.zst
cuberite-394192bdaf6bc285be8258ead6553c3cb4054d2f.zip
-rw-r--r--MCServer/Plugins/InfoDump.lua16
1 files 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