Permalink
Browse files

parser: attributes not present should be omitted

  • Loading branch information...
1 parent 6dab5cc commit be7577222df3557b14b8ba52bcca07b98224adc8 @davidchambers committed Jul 30, 2012
Showing with 4 additions and 8 deletions.
  1. +4 −7 parser.coffee
  2. +0 −1 test/fixtures/cards.coffee
View
@@ -58,13 +58,10 @@ get_converted_mana_cost = (identifier) -> ->
+@text(identifier) or 0
get_text = (identifier) -> ->
- container = @get(identifier)
- if container
- paragraphs = (@text el for el in @get(identifier).children())
- paragraphs = (p for p in paragraphs when p) # exclude empty paragraphs
- paragraphs.join '\n\n' if paragraphs.length
- else
- ""
+ return unless el = @get(identifier)
+ paragraphs = (@text el for el in el.children())
+ paragraphs = (p for p in paragraphs when p) # exclude empty paragraphs
+ paragraphs.join '\n\n' if paragraphs.length
get_versions = (identifier) -> ->
versions = {}
@@ -980,7 +980,6 @@ exports.hill_giant =
converted_mana_cost: 4
subtypes: ["Giant"]
types: ["Creature"]
- text: ""
power: 3
toughness: 3
versions:

0 comments on commit be75772

Please sign in to comment.