Re: [Wikitech-l] ParserAfterParse not called by VisualEditor?

2016-10-08 Thread Alex Monk
On 9 October 2016 at 01:37, James HK  wrote:

> > VE's edits should be (indirectly) going through the action=edit API.
>
> I'm not sure this answer is very helpful. I wonder about this as well
> whether edits initiated by VE/NWE will actually end-up being processed
> by the standard hooks available or not
>

It means yes, all VE edits should be going through the normal API edit
processing code used by thousands of scripts, bots and external clients
every day. I expect it works roughly the same as the UI edit processing
code - if not, that's more likely a bug with ApiEditPage than with the
VisualEditor extension.
https://phabricator.wikimedia.org/diffusion/EVED/browse/master/ApiVisualEditorEdit.php;HEAD$17-57
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] ParserAfterParse not called by VisualEditor?

2016-10-08 Thread Brion Vibber
On Sat, Oct 8, 2016 at 5:37 PM, James HK 
wrote:

> Hi,
>
> > VE's edits should be (indirectly) going through the action=edit API.
>
> I'm not sure this answer is very helpful.


To translate: "it should work exactly the same as edits made with the API",
or to elaborate further: "yes, a ParserAfterParse hook should be called at
parse time after an edit made with VisualEditor, though it won't be
reflected while you're looking at Visual Editor".

There might, however, be something about how the hook is being used that
causes it not to do what is expected when editing is done via the API
versus when it's done using the classic editor form.

For instance, if the hook assumes it's happening during action=edit and
tries to pull data from $_REQUEST or $wgRequest, it will very likely fail
in this and other circumstances when parsing happens separately from an
edit, or happens during an edit but with different parameters and
circumstances than the classic HTML form editor.

Without knowing what the hook is doing, it's hard to say whether something
else might be going wrong.

-- brion
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] ParserAfterParse not called by VisualEditor?

2016-10-08 Thread Alex Monk
VE's edits should be (indirectly) going through the action=edit API.

On 8 October 2016 at 20:56, Stephan Gambke  wrote:

> Hi.
>
> I have an extension that hooks into ParserAfterParse to modify the
> generated HTML (Lingo). The problem is, that apparently this hook is never
> called when a page is edited using Visual Editor, which means my extension
> does not get to modify the page's HTML content until it is purged
> (action=purge) or edited using the old editor.
>
> Is this intentional or is it a VE bug?
> Does anybody have any advice on how I could work around this? E.g. an
> alternative hook I should use?
>
> Cheers
> Stephan
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l




-- 
Alex Monk
VisualEditor/Editing team
https://wikimediafoundation.org/wiki/User:Krenair_(WMF)
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l