1.0.1 • Published 9 years ago

htmlp_parse v1.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
9 years ago
&lt;script type=&quot;text/coffeescript&quot; <span style="color:blue; font-weight: bold;">data-htmlp=&quot;x.coffee&quot;</span>&gt;
<span style="color:red; font-weight: bold;">x = 42</span>
&lt;/script&gt;

&lt;code <span style="color:blue; font-weight: bold;">data-htmlp=&quot;x.coffee&quot;</span>&gt;
<span style="color:red; font-weight: bold;">console.log x is 42</span>
&lt;/code&gt;

&lt;code <span style="color:blue; font-weight: bold;">data-htmlp=&quot;y.coffee&quot;</span>&gt;
<span style="color:red; font-weight: bold;">y = false</span>
&lt;/code&gt;

&lt;/body&gt;
&lt;/html&gt;
### Case 2 ###

case_2_actual = htmlp_parse '&lt;!DOCTYPE html&gt;&lt;html lang=&quot;en&quot;&gt;&lt;head&gt;&lt;meta charset=&quot;UTF-8&quot;&gt;&lt;title&gt;My LP File&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;h1&gt;No file exports here :)&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;'

case_2_expected = {}

assert _.isEqual( case_1_actual, case_1_expected ), 'Case 2 failure'
  _.each file_writes, (element) ->
    if _.isString files[ element.file_name ]
      files[ element.file_name ] += '\n' + element.text
    else
      files[ element.file_name ] = element.text