Code Monkey home page Code Monkey logo

slab's People

Contributors

gcheung55 avatar keeto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

slab's Issues

Linebreak issue in slab

There's a linebreak issue I've experienced in Express.js when rendering one slab file.

I have yet to test in browser.

If my layout slab is:

{slab layout}
<!doctype html>
<html>
    <head>
        <title></title>
    </head>
    <body>
        {body}
    </body>
</html>
{endslab}

The output is:

<!doctype html>
<html>
    <head>
        <title></title>
    </head>
    <body>
        {body}
    </body>
</html>

I'm not sure what the issue is, but its fixed with:

{slab layout}<!doctype html>
<html>
    <head>
        <title></title>
    </head>
    <body>
        {body}
    </body>
</html>{endslab}

Recursive error

I'm getting a recursive error when doing multiple includes without loops.

"Uncaught SlabError: Recursive includes for template "li" (li > otherLi > li)."

var str = '{slab ul}\
    <ul>\
        {include li}\
        {include otherLi}\
    </ul>\
{endslab}\
\
{slab li}\
    <li></li>\
{endslab}\
\
{slab otherLi}\
    {include li}\
{endslab}';

var template = slab.compile(str);

console.log(template.ul({}));

Keep is broken

I'm getting "Uncaught SlabError: Can't compile slab template. Unexpected identifier in the browser with the following code.

var str = '{slab test} \
{keep} \
{slab something} \
<script>var obj = {\'stuff\':\'things\'};</script> \
{endslab} \
{endkeep} \
{endslab}';

var template = Slab.compile(str);

console.log(template.test({}));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.