Giter Club home page Giter Club logo

dsl-html's Introduction

Exodist's GitHub stats

dsl-html's People

Contributors

exodist avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

neilb 17dec

dsl-html's Issues

Escaping ampersand

In your example, you use tag span { 'copyright ©' }, however the ampersand is escaped, so it looks like a literal © when rendered in the browser.

Can be reproduced with the following code:

#!/usr/bin/perl

package blah;

use strict;
use warnings;

use DSL::HTML;

template my_template {
    tag span { 'copyright ©' }
}
print build_template(my_template => '');

Needed API for building HTML fragment seperately

On my (under development) system, I prefer to build a template as fragment which only include the tags I specified, and to push it myself into the container document. I believe this case is legitimate and useful, but it does not seem possible without breaking the encapsulation of DSL::HTML::Rendering.
perhaps, instead of compile, there should be 2 methods : compile() (no container) and compile_document() (with container).

The following code does what I need (if the template has 1 root tag), but is really ugly :
my $r = DSL::HTML::Rendering->new($tpl);
$r->build(@_);
return $r->body->content->[0]->as_HTML(undef, $r->template->indent);

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.