Author: dbenbenn
Description:
See [[User:Dbenbenn/sandbox#Gallery_pipe_trick]], for example. A
link in the caption of a gallery image ending in |]] is broken.
Version: unspecified
Severity: major
Author: dbenbenn
Description:
See [[User:Dbenbenn/sandbox#Gallery_pipe_trick]], for example. A
link in the caption of a gallery image ending in |]] is broken.
Version: unspecified
Severity: major
| Status | Assigned | Task | ||
|---|---|---|---|---|
| Duplicate | None | T26774 rvexpandtemplates=true does not expand templates in ref tags | ||
| Open | None | T28213 Strip marker (UNIQ / QINU) issues (tracking) | ||
| Open | None | T58772 VisualEditor: When using citation templates, the page title and access date fields should be filled automatically | ||
| Stalled | None | T99426 [Migrated] Fix incorrect piped wikilinks | ||
| Open | None | T4700 Pre-save transform skips extensions using wikitext (gallery, references, footnotes, Cite, status indicators, pipe trick, subst, signatures) |
(In reply to comment #69)
(In reply to comment #67)
> I am not too enthusiastic about encouraging extensions to do their own
> arbitrary pre-save transform processing.lowering priority
I am not sure how to equate the "lowering the priority" for a significant issue that doesn't follow normal wiki behaviour? We get numerous responses akin to "I don't like it" however no solutions.
Cite must be one of the most commonly used extensions in wikipedia space, and one would think that it is used multiple times per page. We have a fairly common practice with the renowned pipe trick, and now at comment #69, you are saying that we are "lowering the priority". How about we consider the basic users and solve some of the base underlying issues that bug users every day, or isn't that sexy enough to gather attention? For some of us this is a large annoyance, where we have to create work arounds, by scripting buttons, or doing significant copy and paste.
wicke wrote:
@Billinghurst: Cite can be covered by something like bluehairedlawyer's patch (attachment 5952 / comment 31), as its entire content is parsed as wikitext.
lambdav wrote:
More than 6 years after this bug as been reported, the bug is still there !
How many time should we wait for correction ?
Priority must not be Low !
Nx.devnull wrote:
(In reply to comment #67)
(In reply to comment #65)
> An extension can register a callback and then do pre-save transformation on its
> content - this is the best solution in my opinion, since only the extension
> knows which parts of the content are supposed to be transformed, e.g. in the
> case of the gallery tag only the description part.I am not too enthusiastic about encouraging extensions to do their own
arbitrary pre-save transform processing. In the longer run, general support for
extensions working with parsed (and pre-save transformed) wikitext / HTML DOM
input could be cleaner and should offer better opportunities for integration
with a visual editor. I am working on something like that in the Parsoid parser
(http://mediawiki.org/wiki/Parsoid). There is also a simple and undocumented
method for something vaguely like this in the PHP parser (the
setTransparentTagHook method).However, I do not have a good solution for partly-parsed and -transformed
extensions like gallery. Will give this some thought, and ask others about
their ideas.
If the problem is that extensions could do arbitrary processing instead of the standard PST, then the only solution I can think of is to allow extension to somehow specify which part of their input should be transformed, and then let the parser do the processing. Implementing that would probably be much harder and more cumbersome.
The only thing that needs to be done on my patch is that I'm not sure the extension calling parser->preSaveTransform is 100% safe. I can give it a go if you want, but I don't want to waste my time if the patch will be rejected because my approach (letting the extension do the PST) is not the correct one.
New parsers are nice and all, but they do not fix the problem that we have right now, and they probably never will if you want to keep the current gallery syntax.
bluehairedlawyer wrote:
Actually David's wrong. This bug is seven not six years old. If its not fixed soon we'll have to figure out who's going to pay for it to go to college...
What would be wrong with running the all the contents of a <gallery> through preSaveTransform? I realise it's not wikitext but then preSaveTransform isn't the full parser? What particular pre-save transforms would corrupt the gallery syntax?
Nx.devnull wrote:
(In reply to comment #76)
Actually David's wrong. This bug is seven not six years old. If its not fixed
soon we'll have to figure out who's going to pay for it to go to college...What would be wrong with running the all the contents of a <gallery> through
preSaveTransform? I realise it's not wikitext but then preSaveTransform isn't
the full parser? What particular pre-save transforms would corrupt the gallery
syntax?
I don't know off the top of my head what characters are allowed in filenames (in particular, is [, { or ~ allowed), but in theory:
<gallery>
File:Oh noez [[This is not a link.png|]] yeah, I know, this is a contrived example
</gallery>
There's also replacing tildes, substing and the reverse pipe trick. Replacing tildes would be the most realistic problem (if ~ is allowed in filenames)
[ { are both disallowed in any page name (which includes images). Three or more ~'s in a row is also forbidden in page titles. So you don't have to worry about that.
Personally I favour an approach of adding an interface for adding parserHooks that allows specifying options (such as if the parser hook should allow PST).
Actually David's wrong. This bug is seven not six years old. If its not fixed
soon we'll have to figure out who's going to pay for it to go to college...
That's still a good 11 years away. We're cross that bridge when we come to it.
bluehairedlawyer wrote:
Allow extensions to specify tag contents can be passed through preSaveTransform without being escaped
This is an alternative to Nikola's patch. It allows extensions and internal setHook functions to specify that there contents can be run through the preSaveTransform function without being escaped.
It passes all the current parser tests and a few others I've managed to throw at it.
Attached:
bluehairedlawyer wrote:
Dan Collins has already done this (which is just as well as I haven't figured out how to do it yet). Here's the url:
Dan Collins has two patches, not one:
https://gerrit.wikimedia.org/r/#/c/8784/ (previously mentioned)
and
https://gerrit.wikimedia.org/r/#/c/8785/
Somebdy should really give those patches some love, as apparently the original committer has disappeared.
Gabriel: As you assigned this report to yourself a year ago, do you plean to rework the two patches?
Gabriel: As you assigned this report to yourself two years ago, do you plan to rework the two patches? Or are they "somehow" obsoleted in the meantime?
Change 8784 abandoned by Siebrand:
(Bug 2700) Pre-save transform inside extension hooks
Reason:
I'm abandoning this patch set as it's been open for a long time without any outlook at the open issues being resolved.
If the submitter or anyone else would like to work on it again, this patch set can be re-activated by clicking "Restore Change". Please only do this if you are actually going to work on it immediately.
Change 8785 had a related patch set uploaded (by Paladox):
(bug T4700) Pre-save transform inside extension hooks
Change 8786 had a related patch set uploaded (by MarkTraceur):
Pre-save transform inside extension hooks
I was tooling around with this, but...
https://www.mediawiki.org/wiki/Manual:Tag_extensions#How_do_I_render_wikitext_in_my_extension.3F
This section says that tag extensions will never have PSTs applied to them. So maybe this bug is WONTFIX and we should abandon all patches for it?
This task has not suddenly become more urgent than before, hence reverting the recent Priority change. See https://www.mediawiki.org/wiki/Phabricator/Project_management#Setting_task_priorities for more information. Thanks.
Change 272916 had a related patch set uploaded (by Cenarium):
Pre-save transform inside extension tags
Am I correct in thinking that {{subst:CURRENTMONTH}} and {{subst:CURRENTYEAR}} not being substituded in this edit is due to this bug?
and I would love to see this added to the projects for fixing that are coming up. It is truly time that this got resolved for all wikis.
@Billinghurst add an entry to https://meta.wikimedia.org/wiki/2017_Community_Wishlist_Survey (I guess it would fit in the editing section?).