HARRISBURG, Pa. (AP) — The recount underway in Pennsylvania’s U.S. Senate race marks the end of a chaotic post-election period that has become the latest example of how disputed election rules can expose weak points in a core function of American democracy. The ballot-counting process in the race has become a spectacle of hours-long election board meetings, social media outrage, lawsuits and accusations that some county officials are openly flouting the law. A big part of the dispute has centered around the envelopes that contain mail ballots, including whether they should be counted if the voter didn’t write the correct date. It evokes the battles that have erupted in other states over the role of local election boards in certifying results.