Skip to content

Commit

Permalink
Fixing code initialization when no options provided.
Browse files Browse the repository at this point in the history
  • Loading branch information
kazzkiq committed Apr 30, 2018
1 parent 11a153e commit d664685
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/codeflask.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ CodeFlask.isString = function(x) {

CodeFlask.prototype.run = function(selector, opts) {
var target = CodeFlask.isString(selector) ? this.docroot.querySelectorAll(selector) : [selector];
opts = opts || {};

if(target.length > 1) {
throw 'CodeFlask.js ERROR: run() expects only one element, ' +
Expand Down Expand Up @@ -88,7 +89,7 @@ CodeFlask.prototype.scaffold = function(target, isMultiple, opts) {

if(opts)
{
lang = this.handleLanguage(opts.language);
lang = this.handleLanguage(opts.language || 'html');
}

this.defaultLanguage = target.dataset.language || lang || 'markup';
Expand Down

0 comments on commit d664685

Please sign in to comment.