fix cases when not ends with > and fix regex newline