lang attribute report#26
Merged
cpeel merged 1 commit intoDistributedProofreaders:masterfrom Apr 5, 2026
Merged
Conversation
Reports on 'lang' attributes in two modes. In regular mode, counts all lang attributes by language, producing a report of only how many tags have a lang attribute for each language. In verbose mode, print a report three ways: 1. sort by tag, then language 2. sort by tag content 3. sort by lanuage, then content This ports a feature from the legacy 'pptools' software.
cpeel
approved these changes
Apr 5, 2026
windymilla
approved these changes
Apr 5, 2026
windymilla
left a comment
There was a problem hiding this comment.
Code looks OK to me.
If you end up having trouble with the regexes not working for someone's weird HTML layout, I can thoroughly recommend HTMLParser from html.parser for things like finding all occurrences of a particular tag (used several times in GG2's PPhtml)
srjfoo
approved these changes
Apr 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reports on 'lang' attributes in two modes.
In regular mode, counts all lang attributes by language, producing a report of only how many tags have a lang attribute for each language.
In verbose mode, print a report three ways:
This ports a feature from the legacy 'pptools' software.
Testing notes
A file with no
lang=attributes should produce:Make a file with some number of
lang=attributes (with or without differing languages). Run with verbose mode OFF and you should get something like:Lastly, try with verbose mode. This will produce a report, three ways, as noted above. My sample output is a bit long so I've made it easy to show or hide below.
Click to expand.