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

Don't print empty annotations #294

Merged
merged 1 commit into from
Jun 19, 2024
Merged

Don't print empty annotations #294

merged 1 commit into from
Jun 19, 2024

Conversation

mcncl
Copy link
Contributor

@mcncl mcncl commented Jun 19, 2024

CleanShot 2024-06-19 at 14 58 35

CleanShot 2024-06-19 at 14 59 01

…rders

- Implement annotation count to use with conditional print
for _, a := range buildAnnotations {
summary += annotation.AnnotationSummary(&a)
annotationCount := 0
if len(annotation.AnnotationSummary(&a)) < 230 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this special 230 something to do with the annotation box, etc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the total len with an empty annotation is 227, this allows for special chars that maybe use an additional byte or two

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, what if we used glamour to render this instead. It handles markdown, which is a superset of HTML. A quick test with a string with markdown and html anchor tags and it works nicely

@mcncl mcncl merged commit 76327a1 into 3.x Jun 19, 2024
1 check passed
@mcncl mcncl deleted the SUP-2352/no_empty_annotations branch June 19, 2024 05:41
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