|
@@ -178,12 +178,25 @@
|
|
|
for( var i = 0, len = sectionStack.length; i < len; i++ ) {
|
|
|
// vertical
|
|
|
if( sectionStack[i] instanceof Array ) {
|
|
|
- markdownSections += '<section '+ options.attributes +'>';
|
|
|
+ // 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);
|
|
|
+ slideAttributes = matchAttributes ? matchAttributes[1] : "";
|
|
|
+ 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 || ''; });
|
|
|
+ // console.log('new attr=' + dataAttributes );
|
|
|
+ markdownSections += '<section '+ options.attributes + ' ' + dataAttributes + '>';
|
|
|
+ }
|
|
|
|
|
|
sectionStack[i].forEach( function( child ) {
|
|
|
matchAttributes = slideAttributesSeparatorRegex.exec(child);
|
|
|
slideAttributes = matchAttributes ? matchAttributes[1] : "";
|
|
|
child = matchAttributes ? child.replace(slideAttributesSeparatorRegex,"") : child
|
|
|
+ // console.log('slide attributes ' + options.slideAttributesSeparator + ' => ' + slideAttributes)
|
|
|
markdownSections += '<section ' + slideAttributes + ' data-markdown>' + createMarkdownSlide( child, options ) + '</section>';
|
|
|
} );
|
|
|
|