summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/parser/luadoc.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index 545f9d95..2f5a8ad3 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -1501,21 +1501,22 @@ end
local function trimTailComment(text)
local comment = text
if text:sub(1, 1) == '@' then
- comment = text:sub(2)
+ comment = util.trim(text:sub(2))
end
if text:sub(1, 1) == '#' then
- comment = text:sub(2)
+ comment = util.trim(text:sub(2))
end
if text:sub(1, 2) == '--' then
- comment = text:sub(3)
+ comment = util.trim(text:sub(3))
end
- if comment:find '^%s*[\'"[]' then
+ if comment:find '^%s*[\'"[]'
+ and comment:find '[\'"%]]%s*$' then
local state = compile(comment:gsub('^%s+', ''), 'String')
if state and state.ast then
comment = state.ast[1]
end
end
- return comment
+ return util.trim(comment)
end
local function buildLuaDoc(comment)