co-analysis / a11ytables

R package: generate best-practice stats spreadsheets for publication
https://co-analysis.github.io/a11ytables/
Other
40 stars 3 forks source link

Hyperlink not generated as expected #119

Closed matt-dray closed 5 months ago

matt-dray commented 6 months ago

I think that a markdown hyperlink provided by the user will result in a malformed hyperlink in the output spreadsheet if the text portion contains parentheses (and possibly other characters?).

For example the source statement provided in the demo: providing '[Motor Trend (1974)](https://www.google.com)' results in the output hyperlink '1974)%5d(https:\www.google.com', whereas '[Motor Trend, 1974](https://www.google.com)' works as expected.

This will be due to regex handling. Maybe a case for raw strings with r"{}"?

matt-dray commented 6 months ago

Fixable by ensuring the lookahead is ]( rather than simply (.