issue #191 strip left spaces from usage code

This commit is contained in:
Steve Donovan 2016-06-27 16:25:56 +02:00
parent c9b6483d6d
commit 7bed1fa826
1 changed files with 7 additions and 0 deletions

View File

@ -6,6 +6,7 @@ local class = require 'pl.class'
local utils = require 'pl.utils'
local List = require 'pl.List'
local Map = require 'pl.Map'
local text = require 'pl.text'
local doc = {}
local global = require 'ldoc.builtin.globals'
@ -616,6 +617,12 @@ function Item:finish()
if tags.see then
tags.see = tools.identifier_list(tags.see)
end
if self.usage then
for i = 1,#self.usage do
local usage = self.usage[i]:gsub('^%s*\n','')
self.usage[i] = text.dedent(usage)
end
end
if doc.project_level(self.type) then
-- we are a module, so become one!
self.items = List()