diff options
author | Yves Delley | 2014-09-12 22:49:13 +0200 |
---|---|---|
committer | Yves Delley | 2014-09-12 22:49:13 +0200 |
commit | 9bc5b81292619ef06e9a582a7607b7e0601d7c17 (patch) | |
tree | cc4220eacd9e47cb42cdd237a4fa27038103294c /plugin/markdown/markdown.js | |
parent | 2bc36f2dfe04746d5a10c48531b38c64415d43aa (diff) | |
parent | 80c375fae85d5b1edc2656641e03942739daa28b (diff) |
merged dev branch
Diffstat (limited to 'plugin/markdown/markdown.js')
-rwxr-xr-x | plugin/markdown/markdown.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/plugin/markdown/markdown.js b/plugin/markdown/markdown.js index 19aea28..9afee06 100755 --- a/plugin/markdown/markdown.js +++ b/plugin/markdown/markdown.js @@ -50,7 +50,7 @@ text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}','g'), '\n' ); } else if( leadingWs > 1 ) { - text = text.replace( new RegExp('\\n? {' + leadingWs + '}','g'), '\n' ); + text = text.replace( new RegExp('\\n? {' + leadingWs + '}'), '\n' ); } return text; @@ -219,12 +219,13 @@ xhr.onreadystatechange = function() { if( xhr.readyState === 4 ) { - if ( xhr.status >= 200 && xhr.status < 300 ) { + // file protocol yields status code 0 (useful for local debug, mobile applications etc.) + if ( ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status === 0 ) { section.outerHTML = slidify( xhr.responseText, { separator: section.getAttribute( 'data-separator' ), - verticalSeparator: section.getAttribute( 'data-vertical' ), - notesSeparator: section.getAttribute( 'data-notes' ), + verticalSeparator: section.getAttribute( 'data-separator-vertical' ), + notesSeparator: section.getAttribute( 'data-separator-notes' ), attributes: getForwardedAttributes( section ) }); @@ -251,12 +252,12 @@ } } - else if( section.getAttribute( 'data-separator' ) || section.getAttribute( 'data-vertical' ) || section.getAttribute( 'data-notes' ) ) { + else if( section.getAttribute( 'data-separator' ) || section.getAttribute( 'data-separator-vertical' ) || section.getAttribute( 'data-separator-notes' ) ) { section.outerHTML = slidify( getMarkdownFromSlide( section ), { separator: section.getAttribute( 'data-separator' ), - verticalSeparator: section.getAttribute( 'data-vertical' ), - notesSeparator: section.getAttribute( 'data-notes' ), + verticalSeparator: section.getAttribute( 'data-separator-vertical' ), + notesSeparator: section.getAttribute( 'data-separator-notes' ), attributes: getForwardedAttributes( section ) }); |