Fix markdown vertical wrapping section element generation.
authorVonC <vonc@laposte.net>
Thu, 10 Oct 2013 09:45:39 +0000 (11:45 +0200)
committerVonC <vonc@laposte.net>
Mon, 4 Nov 2013 15:31:25 +0000 (16:31 +0100)
plugin/markdown/markdown.js

index 23b522edc1731497b6e033603f9193dc6b89c8a5..084ba41a816842a5a668d72689c7ed9e90cfabd8 100755 (executable)
                                firstChild = sectionStack[i][0];
                                matchAttributes = slideAttributesSeparatorRegex.exec(firstChild);
                                slideAttributes = matchAttributes ? matchAttributes[1] : "";
+                               dataAttributes = "";
                                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 + '>';
                                }
+                               markdownSections += '<section '+ options.attributes + ' ' + dataAttributes + '>';
 
                                sectionStack[i].forEach( function( child ) {
                                        matchAttributes = slideAttributesSeparatorRegex.exec(child);