Skip to content

St. as Street or Saint #922

@vr8hub

Description

@vr8hub

In typogrify (line 180), we add an abbreviation tag to a list of titles, and change the space following, if present, to a no-break space. St. is one of the abbreviations included.

However, St. can be an abbreviation for Street, not just Saint (which I assume is why we don't tag St. with name-title like we do the other titles), and when it is that, then the no-break space afterwords shouldn't be added.

Since we don't add name-title to St. because the code can't know which it is, shouldn't we not add a no-break space after it for the same reason?

One thought I had is to only add the no-break space (which would have to be done separately from the rest of the titles, obviously) if what follows the St. is an uppercase word. If we wanted to use that logic, we could then add name-title under the same circumstances.

I ran a quick test on my copy of the corpus, and it looks like the above would do the right thing. I looked for any character following the St. to allow for space, no-break space, or dash (lots of things like St.-Auguste in the corpus).

(for i in ./*/ ; do gc -h -o "St\.</abbr>.[A-Z]\w+" $i/src/epub/text/*.xhtml ; done) | sort | uniq

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions