Skip Menu |

This queue is for tickets about the HTML-CalendarMonth CPAN distribution.

Report information
The Basics
Id: 3871
Status: resolved
Priority: 0/
Queue: HTML-CalendarMonth

People
Owner: MSISK [...] cpan.org
Requestors: vishr [...] yahoo-inc.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.09
Fixed in: (no value)



Subject: inconsistent behaviour of wrap content

Message body is not shown because it is too large.

Hi Vish, The problem here is probably a misunderstanding of how these element trees work. Each time you create a new element and insert it into a tree structure, it's a unique object in that structure that cannot appear in more than one place in the tree. So, for example, when you create your BOLD element and wrap it around the year, you then proceed to use that same object reference to wrap target days. Rather than simply wrapping those days in a bold element, like you intended, you are wrapping the day in the bold element *plus everything it contained* -- in essence, you keep wrapping elements with larger and larger sub-trees. The solution is to create a *new* HTML::Element on each iteration in the loop. Think of HTML::Element objects as "use once" entities -- once they are inserted into a tree, they cannot (easily) be reused. Read the copius docs in the HTML::Element module for further information on how to think about, and manipulate, these trees. Cheers, Matt