Skip to content

Commit

Permalink
Add test for "sentence" case on title and container-title (citation-s…
Browse files Browse the repository at this point in the history
…tyle-language#2613)

* Add test for "sentence" case on title and container-title
* Remove "sentence" case for title/container-title for more styles
  • Loading branch information
rmzelle authored and adam3smith committed Apr 2, 2017
1 parent 6f483e4 commit 800c787
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
14 changes: 7 additions & 7 deletions acta-anaesthesiologica-taiwanica.csl
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<group delimiter=". ">
<text variable="title" form="long" font-style="italic" text-case="sentence"/>
<text variable="title" form="long" font-style="italic"/>
<text variable="volume" prefix="vol. " form="long" font-style="italic"/>
<text macro="edition_book"/>
<text macro="publisher_book"/>
Expand All @@ -196,13 +196,13 @@
<else-if type="chapter paper-conference" match="any">
<group delimiter=" ">
<group delimiter=". ">
<text variable="title" form="long" text-case="sentence"/>
<text variable="title" form="long"/>
<group>
<text term="in" form="short" text-case="sentence" suffix=": "/>
<text macro="editor"/>
</group>
<group delimiter=", " font-style="italic">
<text variable="container-title" form="long" font-style="italic" text-case="sentence"/>
<text variable="container-title" form="long" font-style="italic"/>
<text variable="volume" form="long" prefix="vol. " font-style="italic"/>
</group>
<text macro="edition_chapter"/>
Expand All @@ -217,23 +217,23 @@
<else-if type="patent">
<group delimiter=", ">
<group delimiter=". ">
<text variable="title" form="long" text-case="sentence"/>
<text variable="title" form="long"/>
<text variable="number" form="long"/>
</group>
<text macro="year-date_patent"/>
</group>
</else-if>
<else-if type="thesis">
<group delimiter=" ">
<text variable="title" form="long" font-style="italic" suffix="." text-case="sentence"/>
<text variable="title" form="long" font-style="italic" suffix="."/>
<text variable="genre" form="long" suffix="," text-case="sentence"/>
<text macro="publisher_thesis" suffix="," text-case="title"/>
<text macro="year-date_thesis"/>
</group>
</else-if>
<else-if type="webpage">
<group delimiter=" ">
<text variable="title" form="long" suffix=". " text-case="sentence"/>
<text variable="title" form="long" suffix=". "/>
<text variable="container-title" form="long" suffix=". " text-case="title"/>
<text macro="access"/>
<text macro="year-date_webpage"/>
Expand All @@ -243,7 +243,7 @@
<group delimiter=":">
<group delimiter=" ">
<group delimiter=". ">
<text variable="title" form="long" text-case="sentence"/>
<text variable="title" form="long"/>
<text variable="container-title" form="short" text-case="title" strip-periods="true" font-style="italic"/>
</group>
<group delimiter=";">
Expand Down
4 changes: 2 additions & 2 deletions associacao-brasileira-de-normas-tecnicas-ufrgs.csl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
</choose>
</else-if>
<else>
<text variable="title" font-weight="bold" text-case="sentence"/>
<text variable="title" font-weight="bold"/>
</else>
</choose>
</macro>
Expand All @@ -179,7 +179,7 @@
<text variable="container-title"/>
</if>
<else>
<text variable="container-title" font-weight="bold" text-case="sentence"/>
<text variable="container-title" font-weight="bold"/>
</else>
</choose>
</macro>
Expand Down
2 changes: 1 addition & 1 deletion harvard-melbourne-polytechnic.csl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<macro name="title">
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song thesis webpage" match="any">
<text variable="title" font-style="italic" text-case="sentence"/>
<text variable="title" font-style="italic"/>
</if>
<else-if type="patent">
<text variable="title" font-style="italic" quotes="false"/>
Expand Down
10 changes: 10 additions & 0 deletions spec/styles_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@
end
end

it "must not use sentence case for title and container-title variables" do
style.descendants!.each do |node|
if node.matches?("text")
if node[:'text-case'] == 'sentence'
expect(node[:'variable']).not_to match(/^title|container-title$/)
end
end
end
end

describe "name nodes" do
it "must have valid et-al-min and et-al-use-first attributes" do
style.each_descendant do |node|
Expand Down
2 changes: 1 addition & 1 deletion style-manual-australian-government.csl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<macro name="title">
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song thesis webpage" match="any">
<text variable="title" font-style="italic" text-case="sentence"/>
<text variable="title" font-style="italic"/>
</if>
<else>
<text variable="title" quotes="true"/>
Expand Down

0 comments on commit 800c787

Please sign in to comment.