diff options
author | alwo <albrecht.woess@signum.plus> | 2023-03-22 09:36:37 +0100 |
---|---|---|
committer | alwo <albrecht.woess@signum.plus> | 2023-03-22 09:36:37 +0100 |
commit | 98f9f15508f37ca73aa92e8f8943af8a4706df18 (patch) | |
tree | 29b4ecffa91d7b20f898d17e2edc47499e5bae5b /script | |
parent | 759e2f8c303ed9985b1a7cb9ad4886d705576476 (diff) | |
parent | b8627365c0abe5a9d40c91f81b2aef7ea869faad (diff) | |
download | lua-language-server-98f9f15508f37ca73aa92e8f8943af8a4706df18.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'script')
-rw-r--r-- | script/parser/luadoc.lua | 11 |
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) |