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

Add option to set size for which parserPopUp prints an inline string. #1112

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

Conversation

somiaj
Copy link
Contributor

@somiaj somiaj commented Sep 3, 2024

In hardcopy output, allow the size (number of characters) that an inline string [A/B/C] vs a bullet list is printed to be configurable via a new option inlineSize. Note, this slightly changes the default behavior, if the total characters is inlineSize = 25, then the list is now inline instead of a bullet list.

@somiaj
Copy link
Contributor Author

somiaj commented Sep 4, 2024

I have various problems that use drop down menus to fill in the blank in sentences. I do like these being displayed inline in hardcopy rather than a bullet list, hence adding this feature to configure the size this happens, as a few of my cases where just barely over the break point.

I thought about maybe using this for a longer list of choices to keep them in line, but ran into another issue where a single line [A/B/C] can get a little long, and was thinking of allowing configuring the separator, /, so I can put a space on each end, and the list [A / B / C] can wrap at more natural breaks. I do know I could use showStatic => 0 in those cases, but I was just seeing what others would think about allowing configuration of the inline separator as well.

@Alex-Jordan
Copy link
Contributor

Alex-Jordan commented Sep 9, 2024

This seems fine, although I think that before you have to be strictly less than 25 characters long to get it printed inline, but here it's inline when 25 or less. I didn't test, just reading the code. I may be missing a detail.

@drgrice1
Copy link
Member

drgrice1 commented Sep 9, 2024

@Alex-Jordan is correct. The previous condition was length(join('', @list)) < 25 && !grep(/(\/|\[|\])/, @list). So when that was negated to work with unless and the new inlineSize option added it should have become length(join('', @list)) >= $self->{inlineSize} || grep(/(\/|\[|\])/, @list).

@somiaj somiaj force-pushed the popup-configure-pdf-max-size branch from ec71bc3 to 8839e61 Compare September 15, 2024 20:06
@somiaj
Copy link
Contributor Author

somiaj commented Sep 15, 2024

I was aware that I changed the behavior, and even mentioned it in the PR description (as I thought is simplified the logic and the description a bit). I have changed it so now the behavior is the same.

@somiaj somiaj force-pushed the popup-configure-pdf-max-size branch from 8839e61 to a158496 Compare September 29, 2024 03:47
In hardcopy output, allow the size (number of characters)
that an inline string [A/B/C] vs a bullet list is printed to be
configurable via a new option inlineSize.
@somiaj somiaj force-pushed the popup-configure-pdf-max-size branch from a158496 to 0666f64 Compare December 10, 2024 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants