duckduckgo/zeroclickinfo-spice — pull request #1273 by chrisjwilsoncom (2014-11-19 02:50:32+00:00)
Title: Expatistan: Display Result For Country Comparison

Fixes: #1255 (Add more test cases)

The Expatistan API will return a "abstract" result like *"Cost of living in London is 23% higher than in Paris"* for a country comparison.

Due to the regexp used to split the string based on [of](https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/share/spice/expatistan/expatistan.js#L25) the firstline var contains no data when a country comparison is performed.

Simply check if we have an index (number) if not just return the firstline exactly how it is received from the API.

**Before** Live: https://duckduckgo.com/?q=cost+of+living+madrid+vs+london
![image](https://cloud.githubusercontent.com/assets/5282264/5099934/696de992-6fd9-11e4-98bc-b61a77b3bdc9.png)

**After**
![image](https://cloud.githubusercontent.com/assets/5282264/5099935/722982c6-6fd9-11e4-9a58-7b29a6ead824.png)