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

xref of bookmarks: https://github.com/metanorma/metanorma-bipm/issues/67 #236

Merged
merged 1 commit into from
Dec 10, 2020

Conversation

opoudjis
Copy link
Contributor

No description provided.

@opoudjis opoudjis self-assigned this Dec 10, 2020
</annex>
</iso-standard>
OUTPUT
end
Copy link

Choose a reason for hiding this comment

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

end at 2693, 0 is not aligned with it "cross-references bookmarks" do at 2550, 2.

</clause>
</annex>
</iso-standard>
OUTPUT
Copy link

Choose a reason for hiding this comment

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

OUTPUT is not aligned with expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<"INPUT", true))).to be_equivalent_to xmlpp(<<"OUTPUT") or beginning of method definition.

</annex>
</iso-standard>
INPUT
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
Copy link

Choose a reason for hiding this comment

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

Use 2 spaces for indentation in a heredoc.

@@ -2547,6 +2547,151 @@
OUTPUT
end

it "cross-references bookmarks" do
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
<iso-standard xmlns="http://riboseinc.com/isoxml">
Copy link

Choose a reason for hiding this comment

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

Use 2 spaces for indentation in a heredoc.

@@ -2547,6 +2547,151 @@
OUTPUT
end

it "cross-references bookmarks" do
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
Copy link

Choose a reason for hiding this comment

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

Use 2 (not 4) spaces for indentation.
Line is too long. [130/120]

next if n["id"].nil? || n["id"].empty?
@anchors[n["id"]] = {
type: "bookmark", label: nil, value: nil,
xref: @anchors[s["id"]][:xref] }
Copy link

Choose a reason for hiding this comment

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

Closing hash brace must be on the line after the last hash element when opening brace is on a separate line from the first hash element.

notes = s.xpath(ns(".//bookmark")) - s.xpath(ns(".//clause//bookmark")) -
s.xpath(ns(".//appendix//bookmark"))
notes.each do |n|
next if n["id"].nil? || n["id"].empty?
Copy link

Choose a reason for hiding this comment

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

Add empty line after guard clause.
Use n["id"].blank? instead of n["id"].nil? || n["id"].empty?.

@@ -136,5 +136,19 @@ def list_item_anchor_names(list, list_anchor, depth, prev_label, refer_list)
end
end
end

def bookmark_anchor_names(sections)
Copy link

Choose a reason for hiding this comment

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

Assignment Branch Condition size for bookmark_anchor_names is too high. [21.19/15]
Method has too many lines. [11/10]

@opoudjis opoudjis merged commit cdc0ce6 into master Dec 10, 2020
@opoudjis opoudjis deleted the features/bookmark branch December 10, 2020 13:25
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