Add slide attributes for single slide section case.
This commit is contained in:
parent
efbb31cf29
commit
4b0fe47bb6
3 changed files with 42 additions and 3 deletions
|
@ -283,9 +283,18 @@
|
|||
|
||||
}
|
||||
else {
|
||||
|
||||
section.innerHTML = createMarkdownSlide( getMarkdownFromSlide( section ) );
|
||||
|
||||
var content = getMarkdownFromSlide( section );
|
||||
var slideAttributesSeparatorRegex = new RegExp( section.getAttribute( 'data-attributes' ) || DEFAULT_SLIDE_ATTRIBUTES_SEPARATOR, 'm' );
|
||||
var matchAttributes = slideAttributesSeparatorRegex.exec( content );
|
||||
if ( matchAttributes ) {
|
||||
var slideAttributes = matchAttributes[1];
|
||||
content = content.replace( slideAttributesSeparatorRegex,"" );
|
||||
var slideAttributesRegex = new RegExp( "([^\"= ]+?)=\"([^\"=]+?)\"", 'mg' );
|
||||
while( matchesAttributes = slideAttributesRegex.exec( slideAttributes ) ) {
|
||||
section.setAttribute( matchesAttributes[1], matchesAttributes[2] );
|
||||
}
|
||||
}
|
||||
section.innerHTML = createMarkdownSlide( content );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue