Re: XHTML formatter 'xhtml' regions

2009-12-11 Thread David E. Wheeler
On Dec 11, 2009, at 12:08 PM, Ricardo Signes wrote:

> I've fixed this problem, added tests, and created a new method,
> accept_targets_as_html.  This acts like _as_text, but the collected texts are
> emitted literally, without entity escaping.  The 'html' target now uses that
> mechanism.  I removed any mention of my ill-fated experiment.
> 
> This is still in the same branch, though:
> 
>  http://github.com/rjbs/pod-simple/tree/xhtml-region
> 
> I would love to see this merged and deployed before Christmas 2009!

[Pulled](http://github.com/theory/pod-simple/commit/134725656070b94c7df980bebab847f2738c21ed).
 Thanks. I'll likely do a release next week, since this is a regression.

Best,

David

Re: XHTML formatter 'xhtml' regions

2009-12-11 Thread Ricardo Signes
* Ricardo Signes  [2009-12-11T14:40:52]
> David and I spoke on AIM.  This is 99.99% a regression introduced in October!
> I will fix it.

I've fixed this problem, added tests, and created a new method,
accept_targets_as_html.  This acts like _as_text, but the collected texts are
emitted literally, without entity escaping.  The 'html' target now uses that
mechanism.  I removed any mention of my ill-fated experiment.

This is still in the same branch, though:

  http://github.com/rjbs/pod-simple/tree/xhtml-region

I would love to see this merged and deployed before Christmas 2009!

-- 
rjbs


Re: XHTML formatter 'xhtml' regions

2009-12-11 Thread Ricardo Signes
* "David E. Wheeler"  [2009-12-11T14:02:33]
> I asked Graham earlier this week if he'd consider switching to
> Pod::Simple::XHTML, and his comment was that, if we did that, and someone had
> invalid html in a `=for html` section, it would make the whole document
> invalid. Of course, we were both working on the assumption that `=for html`
> stuff would be passed through unmolested.
> 
> I'm not sure it should be. I mean, it'd be easiest to do so, but another
> choice might be to parse it and fix validation issues.

I think it's way out of scope to validate here.  I think it's totally
reasonable to make sure there's a hook for doing so.

> But at any rate, the current implementation of escaping the content seems
> wrong to me. If I wanted that, I'd use a verbatim block.

David and I spoke on AIM.  This is 99.99% a regression introduced in October!
I will fix it.

-- 
rjbs


Re: XHTML formatter 'xhtml' regions

2009-12-11 Thread David E. Wheeler
On Dec 11, 2009, at 11:20 AM, Allison Randal wrote:

>>> Anybody know?  I would like to get this sorted out so I can rely on it. :)
> 
> According to perlpodspec, '=for html' is supposed to be a pass-through, and 
> '=for :html' is supposed to do normal processing on the contents of the 
> block. So, the current behaviour of Pod::Simple::XHTML can be considered a 
> bug.

Yeah, RJBS found where I introduced it 
[here](http://github.com/theory/pod-simple/commit/1ac6b65b7d323f20bf618af34b99d1b2cf550a84).
 So we just need a flag to tell handle_text() not to escape its contents when 
its a `=for html` block.

A regression. Bleh. Sorry about that.

Best,

David

Re: XHTML formatter 'xhtml' regions

2009-12-11 Thread Allison Randal

David E. Wheeler wrote:

On Dec 11, 2009, at 10:58 AM, Ricardo Signes wrote:


 http://github.com/rjbs/pod-simple/tree/xhtml-region

David and I spoke about this on AIM a little...

Right now, given this input in Pod::Simple::HTML:

 =begin html

 ...

 =end html

The HTML is passed through untouched.  If you do the same thing in
Pod::Simple::XHTML, the HTML is entity escaped before being passed along.

I had assumed this was intentional, and my changes add an 'xhtml' region which
is untouched.  David suggested that this is an error.

Anybody know?  I would like to get this sorted out so I can rely on it. :)


According to perlpodspec, '=for html' is supposed to be a pass-through, 
and '=for :html' is supposed to do normal processing on the contents of 
the block. So, the current behaviour of Pod::Simple::XHTML can be 
considered a bug.


Allison


Re: XHTML formatter 'xhtml' regions

2009-12-11 Thread David E. Wheeler
On Dec 11, 2009, at 10:58 AM, Ricardo Signes wrote:

>>  http://github.com/rjbs/pod-simple/tree/xhtml-region
> 
> David and I spoke about this on AIM a little...
> 
> Right now, given this input in Pod::Simple::HTML:
> 
>  =begin html
> 
>  ...
> 
>  =end html
> 
> The HTML is passed through untouched.  If you do the same thing in
> Pod::Simple::XHTML, the HTML is entity escaped before being passed along.
> 
> I had assumed this was intentional, and my changes add an 'xhtml' region which
> is untouched.  David suggested that this is an error.
> 
> Anybody know?  I would like to get this sorted out so I can rely on it. :)

I asked Graham earlier this week if he'd consider switching to 
Pod::Simple::XHTML, and his comment was that, if we did that, and someone had 
invalid html in a `=for html` section, it would make the whole document 
invalid. Of course, we were both working on the assumption that `=for html` 
stuff would be passed through unmolested.

I'm not sure it should be. I mean, it'd be easiest to do so, but another choice 
might be to parse it and fix validation issues.

But at any rate, the current implementation of escaping the content seems wrong 
to me. If I wanted that, I'd use a verbatim block.

Best,

David

Re: XHTML formatter 'xhtml' regions

2009-12-11 Thread Ricardo Signes
* Ricardo Signes  [2009-12-11T13:36:32]
> * "David E. Wheeler"  [2009-12-11T12:56:28]
> > 
> > Sounds useful. What does the patch look like?
> 
> Right now, it's a subclass.  I will make a patch in a branch on Github...
> 
> That was easy!
> 
>   http://github.com/rjbs/pod-simple/tree/xhtml-region

David and I spoke about this on AIM a little...

Right now, given this input in Pod::Simple::HTML:

  =begin html

  ...

  =end html

The HTML is passed through untouched.  If you do the same thing in
Pod::Simple::XHTML, the HTML is entity escaped before being passed along.

I had assumed this was intentional, and my changes add an 'xhtml' region which
is untouched.  David suggested that this is an error.

Anybody know?  I would like to get this sorted out so I can rely on it. :)

-- 
rjbs


Re: XHTML formatter 'xhtml' regions

2009-12-11 Thread Ricardo Signes
* "David E. Wheeler"  [2009-12-11T12:56:28]
> > 
> >  =for xhtml ...
> > 
> > ...pass the XHTML right through.  This is invaluable for producing my
> > colorized code samples.  (I assume it also works as a begin/end block.)
> > 
> > If it is welcome, I will add it to Pod::Simple::XHTML and issue another
> > pull request.  If not, I will release it as a subclass.
> 
> Sounds useful. What does the patch look like?

Right now, it's a subclass.  I will make a patch in a branch on Github...

That was easy!

  http://github.com/rjbs/pod-simple/tree/xhtml-region

-- 
rjbs


Re: XHTML formatter 'xhtml' regions

2009-12-11 Thread David E. Wheeler
On Dec 11, 2009, at 9:43 AM, Ricardo Signes wrote:

> I recently got my Advent calendar converted entirely to Pod::Simple where it
> had previously used Pod::Parser.  I needed two features added.
> 
> I sent Allison and David a pull request for the first, this morning.  It 
> allows
> you to say "=head1 becomes " or "becomes " and so on, which makes it
> easier to produce an HTML fragment for inclusion in a larger document.
> 
> I am unsure whether the other feature is welcome.  It makes this:
> 
>  =for xhtml ...
> 
> ...pass the XHTML right through.  This is invaluable for producing my 
> colorized
> code samples.  (I assume it also works as a begin/end block.)
> 
> If it is welcome, I will add it to Pod::Simple::XHTML and issue another pull
> request.  If not, I will release it as a subclass.

Sounds useful. What does the patch look like?

Best,

David

XHTML formatter 'xhtml' regions

2009-12-11 Thread Ricardo Signes

I recently got my Advent calendar converted entirely to Pod::Simple where it
had previously used Pod::Parser.  I needed two features added.

I sent Allison and David a pull request for the first, this morning.  It allows
you to say "=head1 becomes " or "becomes " and so on, which makes it
easier to produce an HTML fragment for inclusion in a larger document.

I am unsure whether the other feature is welcome.  It makes this:

  =for xhtml ...

...pass the XHTML right through.  This is invaluable for producing my colorized
code samples.  (I assume it also works as a begin/end block.)

If it is welcome, I will add it to Pod::Simple::XHTML and issue another pull
request.  If not, I will release it as a subclass.

-- 
rjbs