nl_tokens: Creates the content of a complex template . It should contain as many pitfalls for correct processing as possible .
pl_tokens: function createComplexTemplate ( templateLanguage , options ) { var t = getTemplateLanguageConstructs ( templateLanguage ) , indent = options && options . indentation || "" , insert = options && <mask> . insertion || "" , lines = [ '<!-- top-level comment (single line) -->' , '<!--' , '  top-level' , '  comment' , '  (multi-line)' , '-->' , t . if , '<p>This is a %%paragraph' , 'Some random %%text&& with different line breaks.<br><br/><br />' , t . else , '<h1 class="header">This is a %%header&&</h1>    ' , t . endIf , t . if , '</p>' , t . endIf , insert , 'Some top-level %%text&&, not wrapped in a tag.<br><br/><br />' , '<!-- comment containing a <div> tag -->' , "<" + "script>alert( 'foo' );</" + "script>" , '<p class="significantWhitespaceExpected">' , '  some text  </p>' , '<%%tagName&& %%attrs&&>lorem ipsum</%%tagName&&>' , '<p><h1>Invalid nesting</h1></p>' , t . partial , '<dl class="%%dl_class&&">' , '  ' + t . loop , '  <dt class="dtclass">%%dd_name&&</dt>' , '  <dd class="ddclass">%%dd_content&&</dd>' , '  ' + t . endLoop , '</dl>' ] , innerContent = _ . map ( lines , function ( line ) { return indent + line ; } ) . join ( "\n" ) ; return innerContent . replace ( / %% / g , t . startDelimiter ) . replace ( / && / g , t . endDelimiter ) ; }