Closed cotto closed 9 years ago
Thanks! We get those entities rendering properly.
Yeah. That was github being helpful. Here's a screenshot in Chrome 43.0.2357.134 on Windows. I saw the same thing in Firefox nightly on Linux.
@cotto Thanks for reporting this.
Issue The API is returning HTML entities
See: https://duckduckgo.com/js/spice/bible/hosea%2011%3A9
Fix:
Use stripHTML
in handlebars template
Notes This API should moved away from the base
template group: https://github.com/duckduckgo/zeroclickinfo-spice/blob/ed05efa4152f627dd3e54821bca2eb563d105192/share/spice/bible/bible.js#L22
@MrChrisW #stripHTML
doesn't work. Handlebars can't decode HTML entities. Have to do it in JS, something like this -
var text = $('<textarea />').html(data.text).text();
@iambibhas That's correct :+1: Thanks for the clarification. In reality the API shouldn't be passing HTML entities.
The instant answer for hosea 11:9 shows some mojobake:
I cannot carry out my fierce anger! I cannot totally destroy Ephraim! Because I am God, and not man – the Holy One among you – I will not come in wrath!
IA Page: http://duck.co/ia/view/bible