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

Allow disabling numbering inherited from a paragraph style #2531

Merged
merged 1 commit into from
May 20, 2024

Conversation

kalda341
Copy link
Contributor

@kalda341 kalda341 commented Jan 9, 2024

No description provided.

Copy link

codecov bot commented Jan 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6b8e223) 100.00% compared to head (2e97d8d) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2531   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          280       280           
  Lines        14021     14025    +4     
  Branches      1369      1370    +1     
=========================================
+ Hits         14021     14025    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kalda341
Copy link
Contributor Author

Hi @dolanmiu, have you had a chance to look over this?

@@ -135,6 +137,8 @@ export class ParagraphProperties extends IgnoreIfEmptyXmlComponent {
});

this.push(new NumberProperties(`${options.numbering.reference}-${options.numbering.instance ?? 0}`, options.numbering.level));
} else if (options.numbering === false) {
Copy link
Owner

Choose a reason for hiding this comment

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

Better to check for undefined I think rather than false, so it is idiomatic with this library

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we check for undefined then we'll be disabling inherited numbering by default (not what we're looking for), unless we treat undefined different to a missing value.
Maybe null is a better fit than undefined then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dolanmiu Any thoughts?

Copy link
Owner

Choose a reason for hiding this comment

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

I see what you mean

Yes looks good, I like how it can be set to false, which has clear intent

Approved, merging

@dolanmiu dolanmiu merged commit f98f852 into dolanmiu:master May 20, 2024
8 checks passed
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.

2 participants