Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

truncate annotation page label instead of error #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abaevbog
Copy link
Contributor

Addresses #131
Truncates annotationPageLabel to be at most maxAnnotationPageLabelLength so the error is not thrown if annotation page label is too long.

@abaevbog abaevbog requested a review from dstillman June 13, 2023 16:11
@abaevbog abaevbog linked an issue Jun 13, 2023 that may be closed by this pull request
case 'annotationSortIndex':
case 'annotationPosition':
$item->$key = $val;
break;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep newline after break;


case 'annotationPageLabel':
$item->$key = substr($val, 0, Zotero_Items::$maxAnnotationPageLabelLength);
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newline after break;

Truncates annotationPageLabel to be at most maxAnnotationPageLabelLength so the error is not thrown if annotation page label is too long.
Fixes: zotero#131
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Automatically truncate annotation page label
2 participants