@@ -145,7 +145,7 @@ TextEnvironment.prototype._renderCloseText = function(node) {
145145 node . children , newTextStyle ) ;
146146 if ( node . whitespace ) this . _html . putText ( ' ' ) ;
147147 this . _html . putSpan ( closeTextEnv . renderToHTML ( ) ) ;
148- }
148+ } ;
149149
150150TextEnvironment . prototype . renderToHTML = function ( ) {
151151 this . _html = new HTMLBuilder ( ) ;
@@ -209,7 +209,7 @@ TextEnvironment.prototype.renderToHTML = function() {
209209 // \CALL{funcName}{funcArgs}
210210 // ==>
211211 // funcName(funcArgs)
212- this . _html . beginSpan ( 'ps-funcname' ) . putText ( text ) . endSpan ( )
212+ this . _html . beginSpan ( 'ps-funcname' ) . putText ( text ) . endSpan ( ) ;
213213 this . _html . write ( '(' ) ;
214214 var argsTextNode = node . children [ 0 ] ;
215215 this . _renderCloseText ( argsTextNode ) ;
@@ -413,6 +413,8 @@ function RendererOptions(options) {
413413 this . lineNumberPunc = options . lineNumberPunc || ':' ;
414414 this . lineNumber = options . lineNumber !== undefined ? options . lineNumber : false ;
415415 this . noEnd = options . noEnd !== undefined ? options . noEnd : false ;
416+ if ( options . captionCount !== undefined )
417+ Renderer . captionCount = options . captionCount ;
416418}
417419
418420RendererOptions . prototype . _parseEmVal = function ( emVal ) {
@@ -438,7 +440,7 @@ function Renderer(parser, options) {
438440}
439441
440442/* The global counter for the numbering of the algorithm environment */
441- Renderer . _captionCount = 0 ;
443+ Renderer . captionCount = 0 ;
442444
443445Renderer . prototype . toMarkup = function ( ) {
444446 var html = this . _html = new HTMLBuilder ( ) ;
@@ -567,7 +569,7 @@ Renderer.prototype._buildTree = function(node) {
567569 child = node . children [ ci ] ;
568570 if ( child . type !== 'caption' ) continue ;
569571 lastCaptionNode = child ;
570- Renderer . _captionCount ++ ;
572+ Renderer . captionCount ++ ;
571573 }
572574 // Then, build the header for algorithm
573575 if ( lastCaptionNode ) {
@@ -748,7 +750,7 @@ Renderer.prototype._buildTree = function(node) {
748750 break ;
749751 case 'caption' :
750752 this . _newLine ( ) ;
751- this . _typeKeyword ( 'Algorithm ' + Renderer . _captionCount + ' ' ) ;
753+ this . _typeKeyword ( 'Algorithm ' + Renderer . captionCount + ' ' ) ;
752754 textNode = node . children [ 0 ] ;
753755 this . _buildTree ( textNode ) ;
754756 break ;
0 commit comments