lucaong / jQCloud

jQuery plugin for drawing neat word clouds that actually look like clouds
MIT License
646 stars 293 forks source link

Double escaping url's #26

Closed bboughton closed 12 years ago

bboughton commented 12 years ago

Rails url helpers escape special characters when creating urls, so when jQCloud escapes the url it double escapes it.

<script type="text/javascript" >
  var word_array = [{text: "John's Bday", weight: 1, link: "/posts?tag=John%27s+Bday"}]
</script>

Becomes...

<span id="example_word_1" class="w1">
  <a href="/posts?tag=John%2527s+Bday">John's Bday</a>
</span>

Which doesn't link correctly.

Suggested fix

Adding a boolean option _encodeurls that would allow the user to decide

ettoreboy commented 8 years ago

Just for other fellow developers that had the same problem: the library already has an encodeURI option that can be set to false/true and it is true by default.