HTML-TagTree-v1.03/000755 000765 000024 00000000000 12402362232 014653 5ustar00ddebritostaff000000 000000 HTML-TagTree-v1.03/Changes000644 000765 000024 00000000414 12402153207 016145 0ustar00ddebritostaff000000 000000 Revision history for Perl extension HTML::TagTree. 0.02 Thu Sep 03 14:14:00 2014 - Fixed bad auto newline before certain end tags. (eg textarea, span). 0.01 Sun Jul 24 19:02:31 2011 - original version; created by h2xs 1.23 with options -XA -n HTML::TagTree HTML-TagTree-v1.03/lib/000755 000765 000024 00000000000 12402362232 015421 5ustar00ddebritostaff000000 000000 HTML-TagTree-v1.03/Makefile.PL000644 000765 000024 00000001046 11613363322 016632 0ustar00ddebritostaff000000 000000 use 5.010000; use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( NAME => 'HTML::TagTree', VERSION_FROM => 'lib/HTML/TagTree.pm', # finds $VERSION PREREQ_PM => {}, # e.g., Module::Name => 1.1 ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT => 'lib/HTML/TagTree.pm', # retrieve abstract from module AUTHOR => 'daniel debrito ') : ()), ); HTML-TagTree-v1.03/MANIFEST000644 000765 000024 00000000230 12402362232 015777 0ustar00ddebritostaff000000 000000 Changes Makefile.PL MANIFEST README t/HTML-TagTree.t lib/HTML/TagTree.pm META.yml Module meta-data (added by MakeMaker) HTML-TagTree-v1.03/META.yml000644 000765 000024 00000001017 12402362232 016123 0ustar00ddebritostaff000000 000000 --- #YAML:1.0 name: HTML-TagTree version: v1.03 abstract: lib/HTML/TagTree.pm author: - daniel debrito license: unknown distribution_type: module configure_requires: ExtUtils::MakeMaker: 0 build_requires: ExtUtils::MakeMaker: 0 requires: {} no_index: directory: - t - inc generated_by: ExtUtils::MakeMaker version 6.56 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 HTML-TagTree-v1.03/README000644 000765 000024 00000002412 12402122665 015536 0ustar00ddebritostaff000000 000000 HTML-TagTree version 0.02 ========================= The philosophy of HTML::TagTree is to let you create one region of code with lots of business logic for rendering many possible resulting HTML files/output. This differs from the approach of using business logic code to decide which HTML template (of many) to render. So rather than maintaining many HTML templates, you maintain a Perl file that does all possible customizations of HTML generation. This module strives to minimize typing. Object treeing is just a simple method call, eg: $body->h1->b->i('This is a bold, italic heading'); HTML::TagTree removes the worries of making simple HTML syntax errors such as no matching closing tag for an open tag. INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES This module requires these other modules and libraries: blah blah blah COPYRIGHT AND LICENCE Put the correct copyright and licence information here. Copyright (C) 2011 by daniel debrito This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available. HTML-TagTree-v1.03/t/000755 000765 000024 00000000000 12402362232 015116 5ustar00ddebritostaff000000 000000 HTML-TagTree-v1.03/t/HTML-TagTree.t000644 000765 000024 00000002131 12402152667 017406 0ustar00ddebritostaff000000 000000 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl HTML-TagTree.t' ######################### # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 5; BEGIN { use_ok('HTML::TagTree') }; ######################### # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. my $html = HTML::TagTree->new('html'); ok (defined $html, 'object created'); my $html_output = $html->get_html_text(0,1); ok ($html_output eq '', 'get_html_text'); my $head = $html->head; my $body = $html->body; ok (defined $body, 'child object created'); $html_output = $html->get_html_text(0,1); $html->release; my $textarea = HTML::TagTree->new('textarea','','name=test_textarea placeholder="Enter some text"'); my $result = $textarea->get_html_text(0,1); ok ($result eq '', 'textarea is good. No auto newline before end tag'); done_testing(); HTML-TagTree-v1.03/lib/HTML/000755 000765 000024 00000000000 12402362232 016165 5ustar00ddebritostaff000000 000000 HTML-TagTree-v1.03/lib/HTML/TagTree.pm000644 000765 000024 00000122123 12402362223 020057 0ustar00ddebritostaff000000 000000 ############################################################################### ## ## ## Copyright (c) 2007 - 2013 by Dan DeBrito. ## ## All rights reserved. ## ## ## ## This package is free software; you can redistribute it ## ## and/or modify it under the same terms as Perl itself. ## ## ## ############################################################################### package HTML::TagTree; our $AUTOLOAD; use strict; use version; my $DOUBLE_QUOTE = '"'; my $SINGLE_QUOTE = "'"; our $VERSION = qv('1.03'); my %preprocess_tag; my %empty_tags = ( # Tags that should not contain content or children tags br => 1, input => 1, ); my %tag_open_substitutions = ( ifie => '!--[if IE]', ); my %tag_close_substitutions = ( ifie => '![endif]--', ); my %tags_no_autowhitespace = ( # Don't allow autofilling of whitespace for these tags and any children 'a' => 1, 'code' => 1, 'pre' => 1, 'samp' => 1, 'span' => 1, 'textarea' => 1, ); my %valid_empty_tags_for_shortening = ( # These tags don't need a full close tag but can use abbreviated notation when empty. # eg: #
instead of

area => 1, base => 1, br => 1, canvas => 1, # HTML5 col => 1, frame => 1, hr => 1, input => 1, img => 1, link => 1, meta => 1, option => 1, param => 1, ); my %valid_tags = ( 'a' => 'Defines an anchor 3.0 3.0 STF ', 'abbr' => 'Defines an abbreviation 6.2 STF ', 'acronym' => 'Defines an acronym 6.2 4.0 STF ', 'address' => 'Defines an address element 4.0 4.0 STF ', 'applet' => 'Deprecated. Defines an applet 2.0 3.0 TF ', 'area' => 'Defines an area inside an image map 3.0 3.0 STF ', 'b' => 'Defines bold text 3.0 3.0 STF ', 'base' => 'Defines a base URL for all the links in a page 3.0 3.0 STF ', 'basefont' => 'Deprecated. Defines a base font 3.0 3.0 TF ', 'bdo' => 'Defines the direction of text display 6.2 5.0 STF ', 'big' => 'Defines big text 3.0 3.0 STF ', 'blockquote' => 'Defines a long quotation 3.0 3.0 STF ', 'body' => 'Defines the body element 3.0 3.0 STF ', 'br' => 'Inserts a single line break 3.0 3.0 STF ', 'button' => 'Defines a push button 6.2 4.0 STF ', 'canvas' => 'HTML5', 'caption' => 'Defines a table caption 3.0 3.0 STF ', 'center' => 'Deprecated. Defines centered text 3.0 3.0 TF ', 'cite' => 'Defines a citation 3.0 3.0 STF ', 'code' => 'Defines computer code text 3.0 3.0 STF ', 'col' => 'Defines attributes for table columns 3.0 STF ', 'colgroup' => 'Defines groups of table columns 3.0 STF ', 'dd' => 'Defines a definition description 3.0 3.0 STF ', 'del' => 'Defines deleted text 6.2 4.0 STF ', 'dir' => 'Deprecated. Defines a directory list 3.0 3.0 TF ', 'div' => 'Defines a section in a document 3.0 3.0 STF ', 'dfn' => 'Defines a definition term 3.0 STF ', 'dl' => 'Defines a definition list 3.0 3.0 STF ', 'dt' => 'Defines a definition term 3.0 3.0 STF ', 'em' => 'Defines emphasized text 3.0 3.0 STF ', 'fieldset' => 'Defines a fieldset 6.2 4.0 STF ', 'font' => 'Deprecated. Defines text font, size, and color 3.0 3.0 TF ', 'form' => 'Defines a form 3.0 3.0 STF ', 'frame' => 'Defines a sub window (a frame) 3.0 3.0 F ', 'frameset' => 'Defines a set of frames 3.0 3.0 F ', 'h1' => 'Defines header 1 to header 6 3.0 3.0 STF ', 'h2' => 'Defines header 1 to header 6 3.0 3.0 STF ', 'h3' => 'Defines header 1 to header 6 3.0 3.0 STF ', 'h4' => 'Defines header 1 to header 6 3.0 3.0 STF ', 'h5' => 'Defines header 1 to header 6 3.0 3.0 STF ', 'h6' => 'Defines header 1 to header 6 3.0 3.0 STF ', 'head' => 'Defines information about the document 3.0 3.0 STF ', 'hr' => 'Defines a horizontal rule 3.0 3.0 STF ', 'html' => 'Defines an html document 3.0 3.0 STF ', 'i' => 'Defines italic text 3.0 3.0 STF ', 'ifie' => 'unigue Tag used to define Internet Explorer specific HTML ', 'iframe' => 'Defines an inline sub window (frame) 6.0 4.0 TF ', 'img' => 'Defines an image 3.0 3.0 STF ', 'input' => 'Defines an input field 3.0 3.0 STF ', 'ins' => 'Defines inserted text 6.2 4.0 STF ', 'isindex' => 'Deprecated. Defines a single-line input field 3.0 3.0 TF ', 'kbd' => 'Defines keyboard text 3.0 3.0 STF ', 'label' => 'Defines a label for a form control 6.2 4.0 STF ', 'legend' => 'Defines a title in a fieldset 6.2 4.0 STF ', 'li' => 'Defines a list item 3.0 3.0 STF ', 'link' => 'Defines a resource reference 4.0 3.0 STF ', 'map' => 'Defines an image map 3.0 3.0 STF ', 'menu' => 'Deprecated. Defines a menu list 3.0 3.0 TF ', 'meta' => 'Defines meta information 3.0 3.0 STF ', 'noframes' => 'Defines a noframe section 3.0 3.0 TF ', 'noscript' => 'Defines a noscript section 3.0 3.0 STF ', 'object' => 'Defines an embedded object 3.0 STF ', 'ol' => 'Defines an ordered list 3.0 3.0 STF ', 'optgroup' => 'Defines an option group 6.0 6.0 STF ', 'option' => 'Defines an option in a drop-down list 3.0 3.0 STF ', 'p' => 'Defines a paragraph 3.0 3.0 STF ', 'param' => 'Defines a parameter for an object 3.0 3.0 STF ', 'pre' => 'Defines preformatted text 3.0 3.0 STF ', 'q' => 'Defines a short quotation 6.2 STF ', 's' => 'Deprecated. Defines strikethrough text 3.0 3.0 TF ', 'samp' => 'Defines sample computer code 3.0 3.0 STF ', 'script' => 'Defines a script 3.0 3.0 STF ', 'select' => 'Defines a selectable list 3.0 3.0 STF ', 'small' => 'Defines small text 3.0 3.0 STF ', 'span' => 'Defines a section in a document 4.0 3.0 STF ', 'strike' => 'Deprecated. Defines strikethrough text 3.0 3.0 TF ', 'strong' => 'Defines strong text 3.0 3.0 STF ', 'style' => 'Defines a style definition 4.0 3.0 STF ', 'sub' => 'Defines subscripted text 3.0 3.0 STF ', 'sup' => 'Defines superscripted text 3.0 3.0 STF ', 'table' => 'Defines a table 3.0 3.0 STF ', 'tbody' => 'Defines a table body 4.0 STF ', 'td' => 'Defines a table cell 3.0 3.0 STF ', 'textarea' => 'Defines a text area 3.0 3.0 STF ', 'tfoot' => 'Defines a table footer 4.0 STF ', 'th' => 'Defines a table header 3.0 3.0 STF ', 'thead' => 'Defines a table header 4.0 STF ', 'title' => 'Defines the document title 3.0 3.0 STF ', 'tr' => 'Defines a table row 3.0 3.0 STF ', 'tt' => 'Defines teletype text 3.0 3.0 STF ', 'u' => 'Deprecated. Defines underlined text 3.0 3.0 TF ', 'ul' => 'Defines an unordered list 3.0 3.0 STF ', 'var' => 'Defines a variable 3.0 3.0 STF ', 'xmp' => 'Deprecated. Defines preformatted text 3.0 3.0 ', ); my %element_types = ( header => 'Valid header elements: