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:
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?
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.
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.
Currently, a terminal period will be added to strings in the
blank_cells
andsource
columns of an a11ytable-class object if they're missing. For example:Some text
is converted toSome text.
, andSome text.
remains asSome 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 stringHere is [some text]() to consider.
? It might convert toHere is [some text.]() to consider.
and ultimately to[Here is some text. to consider.]()
, which is just not right.Possible approaches:
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
andsource
columns of an a11ytable. It should be consistent.