Skip Menu |

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

Report information
The Basics
Id: 79778
Status: new
Priority: 0/
Queue: HTML-WikiConverter-PmWiki

People
Owner: Nobody in particular
Requestors: tamara [...] tamaratemple.com
Cc:
AdminCc:

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



Subject: <img> conversions do not leave space after inserting src
Date: Fri, 21 Sep 2012 06:18:57 -0500
To: bug-HTML-WikiConverter-PmWiki [...] rt.cpan.org
From: Tamara Temple <tamara [...] tamaratemple.com>
The conversion of img tags inserts the src attribute, but if the img tag butts up against whatever comes before or after, no space is inserted, which renders the image unusable without further editing. Patch: 152c152 < return $node->attr('src') || ''; --- Show quoted text
> return ' ' . ($node->attr('src') || '') . ' ' ;
Example: HTML input: testfiles/wctest.html: <p>This is how the<img src="http://www.example.com/image.jpg">butts up on both sides.</p> <p>This is how the<img>butts up if no src attribute is given</p> <p><img src="http://www.example.com/image.jpg">This is how it goes at the beginning of the line.</p> <p>This is how it goes at the end of the line<img src="http://www.example.com/image.jpg"></p> Before patch applied: $ perl -MHTML::WikiConverter -e '@in = <STDIN>;$html = join("",@in);$wc=new HTML::WikiConverter(dialect=>"PmWiki2");printf("%s\n\n", $wc->html2wiki($html));' < testfiles/wctest.html This is how thehttp://www.example.com/image.jpg butts up on both sides. This is how the butts up if no src attribute is given http://www.example.com/image.jpg This is how it goes at the beginning of the line. This is how it goes at the end of the linehttp://www.example.com/image.jpg After patch applied: $ perl -MHTML::WikiConverter -e '@in = <STDIN>;$html = join("",@in);$wc=new HTML::WikiConverter(dialect=>"PmWiki2");printf("%s\n\n", $wc->html2wiki($html));' < testfiles/wctest.html This is how the http://www.example.com/image.jpg butts up on both sides. This is how the butts up if no src attribute is given http://www.example.com/image.jpg This is how it goes at the beginning of the line. This is how it goes at the end of the line http://www.example.com/image.jpg Perl version: v5.10.1 Linux version: Linux caesar 2.6.38-15-generic #66-Ubuntu SMP Tue Aug 14 17:25:35 UTC 2012 i686 i686 i386 GNU/Linux Module id = HTML::WikiConverter::PmWiki CPAN_USERID DIBERRI (David Iberri <diberri@cpan.org>) CPAN_VERSION 0.51 CPAN_FILE D/DI/DIBERRI/HTML-WikiConverter-PmWiki-0.51.tar.gz MANPAGE HTML::WikiConverter::PmWiki - Convert HTML to PmWiki markup INST_FILE /usr/local/share/perl/5.10.1/HTML/WikiConverter/PmWiki.pm INST_VERSION 0.51 -- Tamara Temple aka tamouse__ "May you never see a stranger's face in the mirror."
Subject: Re: [rt.cpan.org #79778] AutoReply: <img> conversions do not leave space after inserting src
Date: Fri, 21 Sep 2012 12:22:50 -0500
To: bug-HTML-WikiConverter-PmWiki [...] rt.cpan.org
From: Tamara Temple <tamara [...] tamaratemple.com>
Correction: I pasted the same results for both before and after. The actual before results are: $ perl -MHTML::WikiConverter -e '@in = <STDIN>;$html = join("",@in);$wc=new HTML::WikiConverter(dialect=>"PmWiki");printf("%s\n\n", $wc->html2wiki($html));' < testfiles/wctest.html This is how thehttp://www.example.com/image.jpgbutts up on both sides. This is how thebutts up if no src attribute is given http://www.example.com/image.jpgThis is how it goes at the beginning of the line. This is how it goes at the end of the linehttp://www.example.com/image.jpg On Fri, 21 Sep 2012 07:19:11 -0400, Bugs in HTML-WikiConverter-PmWiki via RT <bug-HTML-WikiConverter-PmWiki@rt.cpan.org> wrote: Show quoted text
> > Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "<img> conversions do not leave space after inserting src", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has been > assigned an ID of [rt.cpan.org #79778]. Your ticket is accessible > on the web at: > > https://rt.cpan.org/Ticket/Display.html?id=79778 > > Please include the string: > > [rt.cpan.org #79778] > > in the subject line of all future correspondence about this issue. To do so, > you may reply to this message. > > Thank you, > bug-HTML-WikiConverter-PmWiki@rt.cpan.org > > ------------------------------------------------------------------------- > The conversion of img tags inserts the src attribute, but if the img > tag butts up against whatever comes before or after, no space is > inserted, which renders the image unusable without further editing. > > Patch: > > 152c152 > < return $node->attr('src') || ''; > ---
>> return ' ' . ($node->attr('src') || '') . ' ' ;
> > > Example: > > HTML input: testfiles/wctest.html: > <p>This is how the<img src="http://www.example.com/image.jpg">butts up > on both sides.</p> > <p>This is how the<img>butts up if no src attribute is given</p> > <p><img src="http://www.example.com/image.jpg">This is how it goes at > the beginning of the line.</p> > <p>This is how it goes at the end of the line<img > src="http://www.example.com/image.jpg"></p> > > Before patch applied: > > $ perl -MHTML::WikiConverter -e '@in = <STDIN>;$html = > join("",@in);$wc=new > HTML::WikiConverter(dialect=>"PmWiki2");printf("%s\n\n", > $wc->html2wiki($html));' < testfiles/wctest.html > This is how thehttp://www.example.com/image.jpg butts up on both sides. > > This is how the butts up if no src attribute is given > > http://www.example.com/image.jpg This is how it goes at the beginning > of the line. > > This is how it goes at the end of the linehttp://www.example.com/image.jpg > > After patch applied: > > $ perl -MHTML::WikiConverter -e '@in = <STDIN>;$html = > join("",@in);$wc=new > HTML::WikiConverter(dialect=>"PmWiki2");printf("%s\n\n", > $wc->html2wiki($html));' < testfiles/wctest.html > This is how the http://www.example.com/image.jpg butts up on both sides. > > This is how the butts up if no src attribute is given > > http://www.example.com/image.jpg This is how it goes at the beginning > of the line. > > This is how it goes at the end of the line http://www.example.com/image.jpg > > > > Perl version: v5.10.1 > Linux version: Linux caesar 2.6.38-15-generic #66-Ubuntu SMP Tue Aug > 14 17:25:35 UTC 2012 i686 i686 i386 GNU/Linux > > Module id = HTML::WikiConverter::PmWiki > CPAN_USERID DIBERRI (David Iberri <diberri@cpan.org>) > CPAN_VERSION 0.51 > CPAN_FILE D/DI/DIBERRI/HTML-WikiConverter-PmWiki-0.51.tar.gz > MANPAGE HTML::WikiConverter::PmWiki - Convert HTML to PmWiki markup > INST_FILE /usr/local/share/perl/5.10.1/HTML/WikiConverter/PmWiki.pm > INST_VERSION 0.51 > > > > > > > -- > Tamara Temple > aka tamouse__ > > "May you never see a stranger's face in the mirror." > > >
-- Tamara Temple aka tamouse__ "May you never see a stranger's face in the mirror."