-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpromscrsample.lua
46 lines (40 loc) · 1.39 KB
/
promscrsample.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
-- function called before the database is opened.
-- No parameter is given.
-- The return values are shown as the information paragraphs.
function _begin()
local name = "World!!"
if _user then
name = _user.name
end
return "Hello, " .. name .. "!!"
end
-- Function called after the database is closed.
-- No parameter is given.
-- The return values are shown as the information paragraphs.
function _end()
local msg = "Knowledge comes, but wisdom lingers."
if _params.act == "edit" then
msg = "Tiger, Fire, Cyber, Fiber, Diver, Viber, Jaa Jaa."
elseif _params.act == "search" then
msg = "Do not say a little in many words but a great deal in a few."
end
return msg
end
-- Function called to convert the Wiki data of each article.
-- `wiki' specifies the Wiki string of the article.
-- The return value is the result data or `nil' if no modification.
function _procart(wiki)
wiki = _strstr(wiki, "Tokyo", "Osaka")
if _regex(wiki, "*sex") or _regex(wiki, "*fuck") then
wiki = _regex(wiki, "^#!", "#! [sexual] ")
end
return wiki
end
-- Function called to convert the HTML data of the whole page.
-- `html' specifies the HTML string of the page.
-- The return value is the result data or `nil' if no modification.
function _procpage(html)
html = _regex(html, '<p( +[a-z]+="[^"]*")* *>', "&<i>")
html = _regex(html, "</p>", "</i>&")
return html
end