Add a beamer note to a section slide using pandoc and markdown

beamermarkdownpandoc

I am using pandoc to convert markdown to beamer slides. I am using the notes in beamer to make note slides. I have slide-level=3 so that the first two markdown headings are sections. I want the section title frames in the presentation, and I want to be able to add a note on section slides. However, pandoc seems to put the notes into a frame. So for instance:

# First Section
\note{I want a note here}

## First Subsection in First Section

::: notes

Using this also does not work

:::

### First Slide

produces the following LaTeX code from pandoc:

\hypertarget{first-section}{%
\section{First Section}\label{first-section}}
 
\begin{frame}{First Section}
\note{I want a note here}
\end{frame}

\hypertarget{first-subsection-in-first-section}{%
\subsection{First Subsection in First Section}\label{first-subsection-in-first-section}}
\begin{frame}{First Subsection in First Section}
\note{Using this also does not work}
\end{frame}

\begin{frame}{First slide}
\protect\hypertarget{first-slide}{}

This adds a blank slide after the section slides that then have the note. This is not what I want. If I go into the tex code and delete the frames, the output pdf is what I want (which means that beamer can handle notes in sections without a frame slide):

\hypertarget{first-section}{%
\section{First Section}\label{first-section}}
 
\note{I want a note here}

\hypertarget{first-subsection-in-first-section}{%
\subsection{First Subsection in First Section}\label{first-subsection-in-first-section}}

\note{Using this also does not work}

\begin{frame}{First slide}
\protect\hypertarget{first-slide}{}

Unfortunately the answers in this question only answer for that specific case, not that general question that was asked. The "hack" here also inserts a frame.

Is there a way to have something passed to into the LaTeX code without a frame?

EDIT: Apparently this is very similar to this question. But it is not the same, because I would like a general solution at any heading level above the slide level.

Best Answer

This was fixed for the single usage of speaker notes in pandoc for beamer in this issue and this commit.