function onSVG( error, svg ) {
		var newNode;
		var parent;
		var i;
		if ( error ) {
			debug( 'Error encountered when attempting to create an SVG: %s', error.message );
			return done( error );
		}
		debug( 'Generated SVG: %s', svg );

		newNode = {
			'type': 'html',
			'value': svg
		};
		parent = equations[ idx ].parent;
		i = equations[ idx ].index;

		/*
		* Case 1: insert new node between equation tags.
		*
		* ```markdown
		* <!-- <equation class="equation" label="eq:triangular_root" align="center" raw="n = \frac{\sqrt{8x+1} - 1}{2}" alt="Triangular root formula."> -->
		*
		* <!-- </equation> -->
		* ```
		*/
		if ( EQN_END.test( parent.children[ i+1 ].value ) ) {
			debug( 'Inserting new node...' );
			parent.children.splice( i+1, 0, newNode );
		}
		/*
		* Case 2: replace existing node.
		*
		* ```markdown
		* <!-- <equation class="equation" label="eq:triangular_root" align="center" raw="n = \frac{\sqrt{8x+1} - 1}{2}" alt="Triangular root formula."> -->
		*
		* <div class="equation" align="center" data-raw-text="n = \frac{\sqrt{8x+1} - 1}{2}" data-equation="eq:triangular_root">
		*     <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@b295a09a80f4fd0cc84682dcda0fe3e354394c0c/lib/node_modules/@stdlib/assert/is-square-triangular-number/docs/img/equation_triangular_root.svg" alt="Triangular root formula.">
		*     <br>
		* </div>
		*
		* <!-- </equation> -->
		* ```
		*/
		else if ( EQN_END.test( parent.children[ i+2 ].value ) ) {
			debug( 'Replacing existing node...' );
			parent.children[ i+1 ] = newNode;
		}
		/*
		* Case 3: replace existing nodes.
		*
		* ```markdown
		* <!-- <equation class="equation" label="eq:triangular_root" align="center" raw="n = \frac{\sqrt{8x+1} - 1}{2}" alt="Triangular root formula."> -->
		*
		* \`\`\`math
		* n = \frac{\sqrt{8x+1} - 1}{2}
		* \`\`\`
		*
		* <!-- <div class="equation" align="center" data-raw-text="n = \frac{\sqrt{8x+1} - 1}{2}" data-equation="eq:triangular_root">
		*     <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@b295a09a80f4fd0cc84682dcda0fe3e354394c0c/lib/node_modules/@stdlib/assert/is-square-triangular-number/docs/img/equation_triangular_root.svg" alt="Triangular root formula.">
		*     <br>
		* </div> -->
		*
		* <!-- </equation> -->
		* ```
		*/
		else if ( EQN_END.test( parent.children[ i+3 ].value ) ) {
			debug( 'Replacing existing nodes...' );

			// Note: we don't splice--we simply replace--in order to avoid invalidating the indices of the equation elements in the AST. If we were to remove children, a subsequent resolved equation index would no longer be accurate...
			parent.children[ i+1 ] = newNode;
			parent.children[ i+2 ] = {
				'type': 'html',
				'value': '<!-- -->'
			};
		}
		// Otherwise, an invalid node...
		else {
			debug( 'Invalid node: %s', parent.children[ idx ].value );
			error = new Error( format( 'invalid node. Invalid equation comment. Ensure that the Markdown file includes both starting and ending equation comments. Node: `%s`.', parent.children[ idx ].value ) );
			return done( error );
		}
		debug( 'Finished processing Markdown equation.' );
		done();
	}
Callback invoked upon converting TeX to SVG.

@private
@param {(Error|null)} error - error object
@param {string} svg - SVG string
@returns {void}