TOC cannot handle archive.org page URL parameters
trying to create links in OL TOC it seems that it cannot handle the URL parameter on archive.org. e.g. chapter one is at but using n11 in OL does not create a link.
@JeffKaplan Do you mean that editing the the table of contents at archive.org is the problem. Or are you referring to Open Library's edit form?
Hi, can I take this one?
It's still a problem. A TOC entry only becomes a link when the page number is all digits (chapter.pagenum.isdigit() in openlibrary/macros/TableOfContents.html, and the same check in SearchResultsWork.html). Archive.org uses page numbers like n11 in its URLs (/page/n11), so those never get a link.
Plan:
- add a small helper that accepts a plain number or
n+ number - use it in both macros
- add tests for the helper
One question: should I also allow roman numerals like xii, or keep it to numbers and n numbers for now?
@cdrini