Last modified: 2014-02-12 23:37:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36613, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34613 - Pipe escape enhancement
Pipe escape enhancement
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
unspecified
All All
: Unprioritized normal with 3 votes (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-23 12:16 UTC by Neill Mitchell
Modified: 2014-02-12 23:37 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Neill Mitchell 2012-02-23 12:16:48 UTC
Hi.

I am entering this after seeing a question posted on the mailing list about having tables within SF text fields. 

There is an extension called PipeEscape that allows for pipe characters in parser function arguments avoid being interpreted as an argument delimiter. This works great if manually used in SF text fields.

Would it be an idea to have this code actually incorporated into SF forms? In this way you can have tables, galleries etc in SF text area fields without the user having to manually insert (or even being aware of) the PipeEscape extension markup.

Cheers
Neill.
Comment 1 Neill Mitchell 2012-02-23 12:33:43 UTC
I'm probably talking nonsense re. SF aren't I. I guess if this should be an SMW enhancement.

Neill.
Comment 2 dvdgmz 2012-02-23 12:34:47 UTC
It seems me a useful feature.

Maybe the fields can have a 'pipeescape' parameter:

{{{field|MyField|pipeescape=true}}}

Another approach could be having parameters to put content in the field value before and after the content entered by the user:

{{{field|MyField|before=|after=}}}

In this case we can put:

{{{field|MyField|before={{#!:|after=}} }}}

resulting:

{{MyTemplate
|MyField={{#!:
Content introduced by the user
}}
}}

and perhaps this could be useful for other cases.
But I don't know if is something difficult to implement.

- dvdgmz.
Comment 3 Neill Mitchell 2012-02-23 13:12:18 UTC
No, actually this is a SF problem as well.

It is all very well wrapping the text field in the template with the pipe escape, but next time you edit with form the entered text will get busted if a pipe char is present. So you have to have the pipe escape parser call actually in the field meaning the users have to be aware of it and how to use it. This is not ideal.

So, the SF parser would benefit from pipe escaping text fields.

Cheers
Neill.
Comment 4 Yaron Koren 2012-02-23 14:19:51 UTC
dvdgmz - both of those syntax ideas you suggest sound useful. Especially the second one. I'm always afraid to make the SF template-parsing code any more complicated than it already is, but in theory, I think that's a good idea.
Comment 5 Neill Mitchell 2012-02-23 15:13:16 UTC
The before and after idea would be really useful. I could see that being used for all sorts of things :) 

A pipescape parameter might be simpler to implement though ;)
Comment 6 Al Johnson 2013-02-25 12:34:52 UTC
I have properties that hold full text in it's values and has to handle any character.  This is not just a pretty formatting issue; one single character that is inaccurate to what the user intends will break my process. I vote for this to be resolved.
Comment 7 Alex 2013-12-11 16:51:58 UTC
Yes I agree.. seems like it would be useful.. perhaps a simple fix would just be to convert the | [ ] into the html equivalent on upload or when saved through a form?

The html equivalent representations work but not on upload of xml.
Comment 8 Buba 2013-12-11 17:51:24 UTC
I agree with Alex. It would be great if the html equivalent representations works on xml upload...

Anyway, getting it fixed without making it more complex than it is, is more important. So I vote for it.
Comment 9 Neill Mitchell 2013-12-12 15:28:32 UTC
Ordinary users can't be expected to "double-escape" the relevant characters, by replacing "{" with "[", and so on. 

Surely this can be sorted with a small code tweak?

Thanks.
Comment 10 Alex 2013-12-13 15:06:24 UTC
(In reply to comment #9)
> Ordinary users can't be expected to "double-escape" the relevant characters,
> by
> replacing "{" with "[", and so on. 
> 
> Surely this can be sorted with a small code tweak?
> 
> Thanks.

Yeah I'd agree with that the average user that will be editing the forms manually shouldn't have to know how to do this.

Which php files would need to be edited to add this logic? I was thinking just to add the feature on my side here.
Comment 11 Yaron Koren 2013-12-13 16:05:46 UTC
Just to clarify, the double-escaping is only needed if you're doing an XML import - due, I assume, to some sort of bug in Special:Import.
Comment 12 Alex 2013-12-14 20:51:37 UTC
It's probably a normal feature of an xml parser to convert the html entities to ascii.

Inserting in the interface one does not need to double escape.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links