Q:

Ignoring \par commands with \renewcommand{\par}{}?

I would like to ignore \par commands in a predefined LaTeX file. I simply tried:
\renewcommand{\par}{}

but this does not work as \par is ending the paragraph within the \renewcommand command.
! Paragraph ended before \renew@command was complete.

Is there a way to do this?

A:

You can easily redefine \par:
\def\par{}

But it is only safe to do this in very controlled contexts, for example:
This document will not terminate and you will need to kill the process
\documentclass{article}

\begin{document}

\def\par{}

aaaaa

\hrule

\end{document}

