You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See microformats/mf2py#104. For backwards compatibility parsing, the Python parser changes the DOM on the fly. I believe the PHP parser does a similar thing. It turns out that – in the case of the Python parser – the same DOM object can’t be parsed successfully a second time. The microformats in the base document have been “damaged”.
How can we best test if this is the case with our parser too? Maybe also add a test case where we check that a second parse gives the same result?
Needs investigating. Thanks @kartikprabhu for bringing this up!
(This is basically a todo for myself, therefore also assigning myself.)
The text was updated successfully, but these errors were encountered:
Confirmed in php-mf2 if you pass in a DOMDocument, it's modified during parsing:
Input HTML:
<divclass="hentry"><divclass="entry-content"><pclass="entry-summary">This is a summary</p><p>This is <ahref="/tags/mytag" rel="tag">mytag</a> inside content. </p></div></div>
<divclass="hentry"><divclass="entry-content"><pclass="entry-summary">This is a summary</p><p>This is <ahref="/tags/mytag" rel="tag">mytag</a> inside content. </p></div></div><divclass="hentry h-entry"><divclass="entry-content e-content"><pclass="entry-summary p-summary">This is a summary</p><p>This is <ahref="/tags/mytag" rel="tag">mytag</a> inside content. </p></div><dataclass="category p-category" value="mytag"></data></div>
A DOMDocument instance being passed to the parser should not have
changed after parsing. This could potentially trip-up further use of
the same DOMDocument instance.
See microformats#174.
Zegnat
added a commit
to Zegnat/php-mf2
that referenced
this issue
May 27, 2018
See microformats/mf2py#104. For backwards compatibility parsing, the Python parser changes the DOM on the fly. I believe the PHP parser does a similar thing. It turns out that – in the case of the Python parser – the same DOM object can’t be parsed successfully a second time. The microformats in the base document have been “damaged”.
How can we best test if this is the case with our parser too? Maybe also add a test case where we check that a second parse gives the same result?
Needs investigating. Thanks @kartikprabhu for bringing this up!
(This is basically a todo for myself, therefore also assigning myself.)
The text was updated successfully, but these errors were encountered: