Lafougere / node-cfml

a simple cfml view engine for node.js/express
GNU General Public License v2.0
9 stars 3 forks source link

First < is removed #3

Closed AndrewKralovec closed 5 years ago

AndrewKralovec commented 6 years ago

When parseing the cfml files, the fist '<' is striped from the page. This issue is occurring in cfml.js In processQueue function, the bracket is picked up as an other tag. buf[buf.length - 1] is undefined at this point, so the '<' is not added and the string sliced at index 1. The fist tag does not get processed correctly. I quick fix is to add the '<' at the begging of the rendered result, but a more permanent solution should be put in place.

Input

<html>
    <h2>Hello World</h2>
    <cfset test = "10">
    <cfoutput>
        #test#
    </cfoutput>
</html>

Output

html>
    <h2>Hello World</h2>

        10

</html>

Expected output


<html>
    <h2>Hello World</h2>

        10

</html>
AndrewKralovec commented 5 years ago

Resolved by https://github.com/Lafougere/node-cfml/pull/2