garretus / phpquery

Automatically exported from code.google.com/p/phpquery
0 stars 0 forks source link

inserting html with html html() method don't work #49

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Get this string "La Thermo-sonde de cuisson vous permet de cuire à la
perfection au four comme au bain-marie. Température: entre <b>0°C et
210°C</b>."
2. Inserting it in a P element using
<php>$myPhpQuery->find('p#myP')->html($myString);</php>
3.

What is the expected output? What do you see instead?
Should display "0°C et 210°C" in bold, instead of that it display "<b>0°C
et 210°C</b>".

What version of the product are you using? On what operating system?
r168

Please provide any additional information below.
Perhaps it don't detect the markup...

Original issue reported on code.google.com by nicolas....@gmail.com on 2 Oct 2008 at 1:30

GoogleCodeExporter commented 8 years ago
Fixed in r186.
Test case added in test_manipulation.php, but please check if this doesnt broke 
other
functionalities.

Original comment by tobiasz....@gmail.com on 2 Oct 2008 at 3:26

GoogleCodeExporter commented 8 years ago
It seems to work... but it seems to work strangely oO.
When putting the new version of phpQuery online, it destruct all my layers oO.

My website is totally deformed :(.
I thinks that's come from I use html() to insert text cause previously we can't 
do
that with text()...

Original comment by nicolas....@gmail.com on 2 Oct 2008 at 3:34

GoogleCodeExporter commented 8 years ago
Check r187. There was a problem with text nodes.

Original comment by tobiasz....@gmail.com on 2 Oct 2008 at 3:44

GoogleCodeExporter commented 8 years ago
It seems to be OK !
Thanks :D !

Original comment by nicolas....@gmail.com on 5 Oct 2008 at 9:36

GoogleCodeExporter commented 8 years ago
Damn, that's not really fixed :/.
Sorry.

Using the same string "La Thermo-sonde de cuisson vous permet de cuire à la
perfection au four comme au bain-marie. Température: entre 0°C et 210°C." and
append it using :

<php>$produit_clone->find('p.produit_section_description')->html($myString);</ph
p>

It doesn't apprend it to my pragraph element but create another paragraph 
element and
insert it before the matched paragraph element, like that :

<html>
<p class="produit_section_description" />
<p>
La Thermo-sonde de cuisson vous permet de cuire à la
perfection au four comme au bain-marie. Température: entre 
0°C et 210°C
.
</p>
</html>

You could see it on <url>http://www.atelierdeschefs.net/boutique/</url> (in the
bottom of the page).

Original comment by nicolas....@gmail.com on 6 Oct 2008 at 8:07

GoogleCodeExporter commented 8 years ago
r198 should help. Ive added second test for this scenario.

Original comment by tobiasz....@gmail.com on 6 Oct 2008 at 2:39

GoogleCodeExporter commented 8 years ago
It seems to be OK now ^^ !
Thanks :P !

NB : I'm on IRC if you want.

Original comment by nicolas....@gmail.com on 6 Oct 2008 at 2:46

GoogleCodeExporter commented 8 years ago
Really sorry... but :(.

Trying to append with html() method this string "Hors paragraphe. 
<img align="right" 
src="http://www.stlouisstpierre.com/institution/images/plan.jpg">
<p>Éditorial de l'institution Saint-Pierre.</p>
 Hors paragraphe." it don't work, and let the HTML in full text (cerate an unik text
node so).

Original comment by nicolas....@gmail.com on 6 Oct 2008 at 3:10

GoogleCodeExporter commented 8 years ago
Check test-cases/test_manipulation.php in r199, ive added there you string and 
it
seems to work like it should. Maybe i dont understand something or maybe problem
depends on structure of your document (i'm not saying that structure is a 
problem).

Original comment by tobiasz....@gmail.com on 6 Oct 2008 at 3:24

GoogleCodeExporter commented 8 years ago
I just do more test case with r198, It doesn't work if the first node is a text 
node.
I'll try with r199.

Original comment by nicolas....@gmail.com on 6 Oct 2008 at 3:25

GoogleCodeExporter commented 8 years ago
damn it don't work anymore in my case :/.
Can't understand why.
If you want to login on IRC I could give you some URL where there's the 
problem, but
not here.

Original comment by nicolas....@gmail.com on 6 Oct 2008 at 3:30

GoogleCodeExporter commented 8 years ago

Original comment by tobiasz....@gmail.com on 7 Oct 2008 at 9:58

GoogleCodeExporter commented 8 years ago
Using r201 it seems to be better... BUT [sorry :x] when I do

<php>$myPQ->html('hors paragraphe<p>Test</p>hors paragraphe');</php>

and then

<php>echo $myPQ->html();</php>

it display : "<p>hors paragraphe</p><p>Test</p>hors paragraphe"

humpf :/ the first P element isn't right.

Original comment by nicolas....@gmail.com on 12 Oct 2008 at 1:37

GoogleCodeExporter commented 8 years ago
May be related with issue 60.
http://code.google.com/p/phpquery/issues/detail?id=60

Original comment by tobiasz....@gmail.com on 16 Oct 2008 at 12:13

GoogleCodeExporter commented 8 years ago

Original comment by tobiasz....@gmail.com on 18 Oct 2008 at 8:49