Skip to content

Commit

Permalink
use $.parseHTML to parse prototype HTML of dynamically added inputs
Browse files Browse the repository at this point in the history
- avoids issues during parsing, including problems with parsing whitespace characters
  • Loading branch information
Boris Brtáň authored and PetrHeinz committed Aug 2, 2018
1 parent b5117bb commit 6b718b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -108,7 +108,7 @@
newItemHtml = newItemHtml.replace(/__name__/g, itemData.id);
newItemHtml = newItemHtml.replace(/__category_name__/g, itemData.categoryName);

var $newItem = $(newItemHtml);
var $newItem = $($.parseHTML(newItemHtml));
$newItem.data('load-url', itemData.loadUrl);
$newItem.data('has-children', itemData.hasChildren);
if (itemData.isVisible === false) {
Expand Down
Expand Up @@ -27,7 +27,7 @@
var item = prototype
.replace(/__name__label__/g, index)
.replace(/__name__/g, index);
var $item = $(item);
var $item = $($.parseHTML(item));
$item.data('index', index);

$collection.data('index', index + 1);
Expand Down

0 comments on commit 6b718b4

Please sign in to comment.