[dokuwiki-teams] Re: AW: Plugin PType 'stack'

  • From: "Luis Machuca B." <ryan.chappelle@xxxxxxxx>
  • To: dokuwiki-teams@xxxxxxxxxxxxx
  • Date: Tue, 16 Nov 2010 23:35:01 -0300

Matthias Schulte escribió:
>> So far, only one plugin author replied (Luis Machuca Bezzaza) and has
>> updated his two plugins (divalign2 and linkbonus) and formatplus was also
>> updated. 
> 
> So, no response from the other authors?
> 
I think I can get in contact with the author of the alignment plugin. Other
than that, I'm not sure what I can help with.


>> The reasons I'm now writing to the team(s) are:
>> a) How do we handle the other 6 plugins that haven't updated yet? I think
>> documenting the issue on each plugin's page might be a good idea.
> 
> Agree with that. If someone (with coding skills) could summarize this issue
> In one or two sentences, I will stick it on the involved pages.
> 
> How hard is it to get the other plugin re-working (time effort)? 
> If ist not a hard thing we could provide diff files on the plugin pages.
> 
Oh... speaking of which, as it sounds a good idea: if we are going to
provide updated diffs I can do that for his [plugin:alignment's author]
plugin as well -- his is fork of my fork.

As for a summarizing, here is what I found and based my devel notes on:

ptype=='stack' wraps the content generated by the plugin in a <div> and
makes sure that a previous ongoing paragraph was terminated correctly[1][2].
Previous to 'Anteater' however, a bug made the parser wrap the whole <div>
in yet another <p>[3]. Such undue wrapping could cause plugins to generate
nonconformant XHTML code if they operated under the assumption that they
were generating ptype=='block'-type code; that, among other eventual faults.

[1] (As the new sample in devel:syntax_plugins demonstrates)
[2] (This is particularly important if the code generated by the plugin
could potentially generate new XHTML paragraphs (<p>...</p>) )
[3] (And for inside-generated <p>'s, the problem was made worse as the
paragraph after the wrapper may not be correctly started)

> * A plugin with PType stack before and after Anteater wouldn't be
> backwards compatible. Although Luis has probably found a way to make
> it backwards compatible.
>
[//www.freelists.org/post/dokuwiki/New-release-of-divalign2-plugin-ptypestack-fixes]
>
I just iteratively fixed the XHTML output based on $DOKUWIKI_PATH/VERSION
(if there is a function that returns DW version, I missed it). I won't
recommend my strategy though: AFAIK, it only works at the
TPL_CONTENT_DISPLAY level, because even if the syntax mode's handler/render
can detect that the generated code will be broken, it can not prevent the
exiting </p> from being generated, among other things; also, a fix like mine
"should" break inside include-like plugins (precisely because it executes
too late), and of course it only works with the XHTML renderer.

Still, if anyone want to try it the code is available and the fixing
strategy is somewhat obvious, forgot to /** comment **/.

Sorry if I was too verbose, seems to be part of my charm.

-- 
----
Luis Machuca Bezzaza <luis.machuca [at] gmail.com>
http://informatica.temuco.udelmar.cl/~lmachuca/
----

Other related posts: