rschroll / rmrl

Render reMarkable documents to PDF
GNU General Public License v3.0
119 stars 21 forks source link

Bugfix template selection #14

Open snototter opened 2 years ago

snototter commented 2 years ago

During initialization of DocumentPage instances, a bug caused rmrl to always render the template of the notebook's last page. The bugfix is trivial since this was only a mix-up (max instead of min).

For more context (if needed) - consider the inline documentation prior to the culprit line: https://github.com/rschroll/rmrl/blob/89b5cc38ef45251b96bd3d1c3618429b6b46db92/rmrl/document.py#L60-L64

In such cases, len(template_names) would be less than self.num. Access with max would then raise an IndexError.
For all other exports (where self.num is always less than len(template_names)), this line will always select the last entry within template_names.