That "gap" has nothing to do with Moodle or its HTML editor. It is just the normal vertical separator between 2 consecutive paragraphs.
What you call a "line" is in fact a paragraph (consisting of one line).
If you are creating a "series" of "lines", then you might consider formatting them as lists instead of paragraphs.
1.- Series of one-line paragraphs:
2.- Series of lines separated by a linebreak:
3.- Ordered list:
4.- Unordered (bulleted) list: