Skip to content

Choose how to handle auto-insertion of terminal periods #105

@matt-dray

Description

@matt-dray

Currently, a terminal period will be added to strings in the blank_cells and source columns of an a11ytable-class object if they're missing. For example: Some text is converted to Some text., and Some text. remains as Some text..

The presence of hyperlinks (#47) complicates this. [Some text]() should become [Some text.](). We can detect the presence of a hyperlink in the string and take action if one is found. In this case, we can replace [^\.]\]\( (anything but a period, followed by close-square bracket and open parenthesis) with \.\]\(. What to do if the user provdes the string Here is [some text]() to consider.? It might convert to Here is [some text.]() to consider. and ultimately to [Here is some text. to consider.](), which is just not right.

Possible approaches:

  1. Write code to handle periods properly, even these edge cases. Is that too much effort and spaghetti just to append a period in the right place? Maybe, but it is an accessibility requirement, isn't it?
  2. Just warn the user if it appears there's no terminal period. Can be a bit looser in detection and won't need to write code to do the replacement.
  3. Simply don't bother; leave it entirely to the user, but document it.

As it stands, I think the approach to terminal periods is haphazard. I don't think they're checked on the cover anywhere; only in the blank_cells and source columns of an a11ytable. It should be consistent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accessibilityMeeting the guidelinesdiscussPoint for discussiondocumentationImprove or add documentationenhancementNew feature or requestshouldMoSCoW priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions