#NEWLINE# def combine_math_mdown( chunks ) : #NEWLINE# #INDENT# '\n    combine the math and markdown together.\n    ' #NEWLINE# UNLIKELY_STR = '21db701d30f81f68ef55208b47c183ac' #NEWLINE# res_chunks = [ ] #NEWLINE# math_chunks = [ ] #NEWLINE# for ( i , c ) in enumerate ( chunks ) : #NEWLINE# #INDENT# if ( c [ 'type' ] == 'text' ) : #NEWLINE# #INDENT# res_chunks . append ( c [ 'content' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# res_chunks . append ( UNLIKELY_STR ) #NEWLINE# math_chunks . append ( c [ 'content' ] ) #NEWLINE# #UNINDENT# #UNINDENT# mdown_res = _mdown ( '' . join ( res_chunks ) ) #NEWLINE# for mc in math_chunks : #NEWLINE# #INDENT# mdown_res = mdown_res . replace ( UNLIKELY_STR , mdown_res , 1 ) #NEWLINE# #UNINDENT# return mdown_res