cleans doc (inline and external)