diff options
author | VonC <vonc@laposte.net> | 2013-10-11 08:47:02 +0200 |
---|---|---|
committer | VonC <vonc@laposte.net> | 2013-11-04 16:31:29 +0100 |
commit | d6b8e4a246eab2e17cf63f86423d3e96e111ace4 (patch) | |
tree | 35356c4a348e77667af03ca6c40feeab97ebdcc0 /plugin/markdown | |
parent | ec72e8cbc7e97af9aae28a37a0b92829b2bfe301 (diff) | |
download | fosdem-2018-presentation-d6b8e4a246eab2e17cf63f86423d3e96e111ace4.tar fosdem-2018-presentation-d6b8e4a246eab2e17cf63f86423d3e96e111ace4.tar.gz |
Rebased on dev, and following contribution guideline.
Diffstat (limited to 'plugin/markdown')
-rwxr-xr-x | plugin/markdown/markdown.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugin/markdown/markdown.js b/plugin/markdown/markdown.js index 084ba41..cf2dd29 100755 --- a/plugin/markdown/markdown.js +++ b/plugin/markdown/markdown.js @@ -130,7 +130,7 @@ var separatorRegex = new RegExp( options.separator + ( options.verticalSeparator ? '|' + options.verticalSeparator : '' ), 'mg' ), horizontalSeparatorRegex = new RegExp( options.separator ), - slideAttributesSeparatorRegex = new RegExp( options.slideAttributesSeparator, 'm'); + slideAttributesSeparatorRegex = new RegExp( options.slideAttributesSeparator, 'm' ); var matches, lastIndex = 0, @@ -181,22 +181,22 @@ // The 'data-xxx' attributes of the first child must be set on the wrapping parent section to be effective // Mainly for data-transition (otherwise, it is ignored for the first vertical slide) firstChild = sectionStack[i][0]; - matchAttributes = slideAttributesSeparatorRegex.exec(firstChild); + matchAttributes = slideAttributesSeparatorRegex.exec( firstChild ); slideAttributes = matchAttributes ? matchAttributes[1] : ""; dataAttributes = ""; - if( slideAttributes != "") { + if( slideAttributes != "" ) { // console.log('all attr=' + slideAttributes ); // http://stackoverflow.com/questions/18025762/javascript-regex-replace-all-word-characters-except-word-characters-between-ch // Keep only data-attributes for the parent slide section. - dataAttributes = slideAttributes.replace(/(data-\S+=\"[^\"]+?\")|\w|[\"=]/g, function(a, b) { return b || ''; }); + dataAttributes = slideAttributes.replace( /(data-\S+=\"[^\"]+?\")|\w|[\"=]/g, function(a, b) { return b || ''; }); // console.log('new attr=' + dataAttributes ); } markdownSections += '<section '+ options.attributes + ' ' + dataAttributes + '>'; sectionStack[i].forEach( function( child ) { - matchAttributes = slideAttributesSeparatorRegex.exec(child); + matchAttributes = slideAttributesSeparatorRegex.exec( child ); slideAttributes = matchAttributes ? matchAttributes[1] : ""; - child = matchAttributes ? child.replace(slideAttributesSeparatorRegex,"") : child + child = matchAttributes ? child.replace( slideAttributesSeparatorRegex,"" ) : child // console.log('slide attributes ' + options.slideAttributesSeparator + ' => ' + slideAttributes) markdownSections += '<section ' + slideAttributes + ' data-markdown>' + createMarkdownSlide( child, options ) + '</section>'; } ); @@ -204,9 +204,9 @@ markdownSections += '</section>'; } else { - matchAttributes = slideAttributesSeparatorRegex.exec(sectionStack[i]); + matchAttributes = slideAttributesSeparatorRegex.exec( sectionStack[i] ); slideAttributes = matchAttributes ? matchAttributes[1] : ""; - content = matchAttributes ? sectionStack[i].replace(slideAttributesSeparatorRegex,"") : sectionStack[i] + content = matchAttributes ? sectionStack[i].replace( slideAttributesSeparatorRegex,"" ) : sectionStack[i] //console.log('Slide attributes ' + options.slideAttributesSeparator + ' => ' + slideAttributes) markdownSections += '<section '+ options.attributes + ' ' + slideAttributes +' data-markdown>' + createMarkdownSlide( content, options ) + '</section>'; } |