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

Hide references with hidden bibitems even if they also have a title: … #562

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

opoudjis
Copy link
Contributor

metanorma/metanorma-standoc#709

Metanorma PR checklist

@opoudjis opoudjis self-assigned this Feb 28, 2024
@@ -25,7 +25,9 @@ def move_norm_ref_to_sections(docxml)
def hidden_items(docxml)
docxml.xpath(ns("//references[bibitem/@hidden = 'true']")).each do |x|
x.at(ns("./bibitem[not(@hidden = 'true')]")) and next
x.elements.map(&:name).any? { |n| n != "bibitem" } and next
x.elements.map(&:name).any? do |n|
!%w(title bibitem).include?(n)
Copy link

Choose a reason for hiding this comment

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

Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.

@opoudjis opoudjis marked this pull request as ready for review June 3, 2024 09:32
@opoudjis opoudjis merged commit e69663a into main Jun 3, 2024
18 checks passed
@opoudjis opoudjis deleted the features/attachments branch June 3, 2024 09:33
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.

1 participant