Skip to content

Commit

Permalink
Update how the script is cleaned in getScriptString
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Jul 13, 2017
1 parent 73baca4 commit 2a6294d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dist/grapes.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grapesjs",
"description": "Free and Open Source Web Builder Framework",
"version": "0.9.6",
"version": "0.9.7",
"author": "Artur Arseniev",
"license": "BSD-3-Clause",
"homepage": "http://grapesjs.com",
Expand Down
6 changes: 2 additions & 4 deletions src/dom_components/model/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,8 @@ module.exports = Backbone.Model.extend({
// Need to convert script functions to strings
if (typeof scr == 'function') {
var scrStr = scr.toString().trim();
var lines = scrStr.split('\n');
lines.shift();
lines.pop();
scr = lines.join('\n');
scrStr = scrStr.replace(/^function[\s\w]*\(\)\s?\{/, '').replace(/\}$/, '');
scr = scrStr.trim();
}

var config = this.sm.config || {};
Expand Down

0 comments on commit 2a6294d

Please sign in to comment.