from typing import Optional


def make_headline(comic_id: int, title: str, img_url: str, public_date: Optional[str] = None) -> str:
    """
    Makes the headline string like <number>. <title> and optional <public date>.
    Don't add public date and aligns the text a little for flipping mode.
    """

    if 'http' not in img_url:  # If it's local storage russian comic image don't make link
        link = title
    else:
        url = f'https://xkcd.com/{comic_id}' if comic_id != 880 \
            else 'https://xk3d.xkcd.com/880/'  # Original link is incorrect
        link = f"<a href='{url}'>{title}</a>"

    if public_date:
        return f"<b>{str(comic_id)}. \"{link}\"</b>   <i>({public_date})</i>"
    return f"<b>{str(comic_id) + '.':7}</b>\"{link}\""