/**
 * Removes the empty paragraphs the editor keeps after the last block for the
 * cursor. Applied on both the client and the server so saved and edited
 * content compare equal.
 */
export function trimTrailingEmptyParagraphs(html: string) {
  return html.replace(/(?:\s*<p>(?:\s|<br\s*\/?>)*<\/p>)+\s*$/, "").trim();
}
