I try to understand what's going on with a very simple environment I defined. Please note that I have difficulties to explain the problem. I tries to do my best, but it may not be clear.
Please note that you can find the complete code, along with the result, on this link
I define an environment. And I want a vertical space of 10pt to be added on top of what's included within the tags \begin and \end.
I define something like:
\newenvironment{sectionContent1}{
{ \vspace{10pt} }
}%
See https://fr.sharelatex.com/learn/Environments#Defining_simple_environments: Right after the \newcommand, in between braces, you must write the name of the environment, boxed in the example. Below that are two pairs of braces. Inside the first pair of braces is set what your new environment will do before the text within, then inside the second pair of braces declare what your new environment will do after the text.
Here is the complete code (see also this permanent link):
\documentclass{class}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\setlength{\fboxsep}{0pt}
% Test 1 and 2
% Please note the blank line just above the block "{ \vspace{10pt} }"
\newenvironment{sectionContent1}{
{ \vspace{10pt} }
}%
% Test 3
% Please note the absence of a blank line just above the block "{ \vspace{10pt} }"
\newenvironment{sectionContent2}{
{ \vspace{10pt} }
}%
% Test 4
% The presence of a blanck line between the upper box and the block "{ \vspace{10pt} }" is very important.
% How to insert this blanck line in the block that contains the LaTeX code that is inserted before the text
% when the environment is used ? (https://fr.sharelatex.com/learn/Environments#Defining_a_new_environment)
\newenvironment{sectionContent3}{
{
\vspace{10pt} }
}%
\begin{document}
% Test 1
% There is no blank line before "\begin{sectionContent1}".
% The result is not what I expect it to be. The vertical space between the bottom
% of the upper box and the text within the section is too high (it should be 10pt).
\framebox[\textwidth][c]{Before the section}
\begin{sectionContent1}
\textbf{Test 1}: in the section. The vertical space between the bottom of the upper box and the text
within the section is too high (it should be 10pt).
\end{sectionContent1}
\framebox[\textwidth][c]{After the section}
% Test 2
% There is a blank line before "\begin{sectionContent1}".
% The result is what I expect it to be.
\framebox[\textwidth][c]{Before the section}
\begin{sectionContent1}
\textbf{Test 2}: in the section. The result is what I expect it to be.
\end{sectionContent1}
\framebox[\textwidth][c]{After the section}
% Test 3
% There is a blank line before "\begin{sectionContent2}".
% The result is what I expect it to be.
\framebox[\textwidth][c]{Before the section}
\begin{sectionContent2}
\textbf{Test 3}: in the section. The result is what I expect it to be.
\end{sectionContent2}
\framebox[\textwidth][c]{After the section}
% Test 4
% I tried to put the blank line in the environment definition.
% But it does not work.
\framebox[\textwidth][c]{Before the section}
\begin{sectionContent3}
\textbf{Test 4}: in the section.
\end{sectionContent3}
\framebox[\textwidth][c]{After the section}
\end{document}
Look at the annexe for the file "class.cls". You can also look at this permanent link.
The resulting PDF file can be found on this permanent link.
From these tests I conclude that I can't insert a blank line at the top of the environment definition or within the (first) block that appears in the environment definition. That is:
% A blank line before the first block
\newenvironment{sectionContent1}{
{ \vspace{10pt} }
}%
or
% A blank line within the first block.
\newenvironment{sectionContent3}{
{
\vspace{10pt} }
}%
The important thing seems to be the presence of a blank line before the use of the environment. That is:
\framebox[\textwidth][c]{Before the section}
\begin{sectionContent1}
\textbf{Test 2}: in the section.
\end{sectionContent1}
\framebox[\textwidth][c]{After the section}
or
\framebox[\textwidth][c]{Before the section}
\begin{sectionContent2}
\textbf{Test 3}: in the section.
\end{sectionContent2}
\framebox[\textwidth][c]{After the section}
It seems that any blank line that appears within the definition of the environment (whether before the block or within the block) is just ignored.
I could go with it... but it is not satisfying. Indeed, it implies that the user (of the environment) knows that he has to insert a blank line before the tag \begin that starts the environment. I would prefer the (correct) use of the environment to be independent of the presence of a blank line before the tag \begin.
Could you explain what happens to the blank lines that appear right after \newenvironment{sectionContent} ?
Could you explain what happens to the blank lines that appear within the block { ... \vspace{10pt} } ?
ANNEXE
The file "class.cls"
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{class}[1995/10/30 Standard LaTeX minimal class]
% This class "article" defines many important things.
% See https://tex.stackexchange.com/questions/440462/hline-does-not-produce-anything/440468#440468
\LoadClass{article}
% [geometry] This package provides a flexible and easy interface to page dimensions.
\usepackage[a4paper,
% We set the dimensions of the left and right margins.
left=1cm,
right=1cm,
% We set the dimensions of the top and bottom margins.
top=1cm,
bottom=1cm]{geometry}
% We (must) redefine the font size named "normalsize" (this is mandatory).
% Please note that LaTeX defines other names for font sizes (for example: tiny, small...).
% See https://www.sharelatex.com/learn/Font_sizes,_families,_and_styles#Reference_guide
% WARNING: Make sure to redefine the command "\normalsize" before loading the package "fontspec".
\renewcommand{\normalsize}{\fontsize{10pt}{12pt}\selectfont}