scrivener_html icon indicating copy to clipboard operation
scrivener_html copied to clipboard

SEO header links not taking non-existing pages into account

Open Sgoettschkes opened this issue 7 years ago • 3 comments

Thanks for the library and the whole scrivener libraries!

I have an issue with the header links generated by scrivener_html. If I am reading the code correctly there is currently no checking if the next/prev page does indeed exist?

In my opinion, checking if the next/prev pages exist (by looking the the total_pages in relation to the page_number) and skipping prev/next should do the trick. This would also mean the special cases for the first and last page at https://github.com/mgwidmann/scrivener_html/blob/master/lib/scrivener/html/seo.ex#L42 could be removed as they would be covered.

If you are ok with a PR regarding this I can look into it!

Sgoettschkes avatar Feb 27 '18 11:02 Sgoettschkes

Sorry I missed this. If you'd like to submit a PR, I'd be willing to merge and release it if is a bug like you describe. Thanks for reporting!

mgwidmann avatar Apr 20 '18 20:04 mgwidmann

I'll see to find some time to do the PR!

Sgoettschkes avatar Jun 08 '18 07:06 Sgoettschkes

Should we close this or do you still think this is a valuable addition?

mgwidmann avatar Jan 26 '19 05:01 mgwidmann