The job of a late-night comedian was once so straightforward: Give Americans something to laugh about so they can forget about their workday worries. Presidents always made for comedic fodder, as did the daily headlines. But it was all in good fun. And it generally hovered on the edge of the partisan divide.

Now, the divide is wider. And this has become a time of choosing sides, embracing the politics of the day in all their ubiquity. In Hollywood and New York — where the late-night shows are based — that often means leaning into the resistance to President Trump.

There’s an audience for it, as Stephen Colbert of CBS showed by overtaking Jimmy Fallon of NBC in the ratings, using Mr. Trump as the centerpiece of his act on “The Late Show.” There are also professional accolades in it, as Alec Baldwin’s Emmy Award showed last week.

So late-night comedy has moved further away from the old broadcast network imperatives — safe, not offensive — to seek broader audiences of all political persuasions.