Some of my documents are compiled into multiple outputs. Some Versions contain certain parts, while other versions contain only a placeholder. For this purpose I have a macro \markup that colors its argument red in some versions and omits it in others. Obviously that macro should work just about anywhere, for example in normal text, inside tables, in captions or headlines, etc.
Now when I use \markup (or just \color) in a p column inside a tabular environment, it creates an odd line break that shouldn't really be there. When used in other column types such as c, there is no line break:

I know I could use \textcolor instead of \color (which fixes the issue) but then my macro wouldn't work when the argument contains paragraphs, since \textcolor is not \long. Are there other ways to fix that weird linebreak, accept lone arguments, and still have a macro that works in (nearly) all situations?
\documentclass[margin=1pt]{standalone}
\usepackage{xcolor}
% The actual \markup macro is a bit more complicated and contains an \if
\newcommand\markup[1]{{\color{red}#1}}
\begin{document}
\begin{tabular}{| p{2cm} | c |}
\hline
p\{2cm\} & c \\ \hline
\markup{1} & 2 \\ \hline
3 & \markup{4} \\ \hline
\end{tabular}
\end{document}
