Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki

Re: Replacing Newline using Extension:StringFunctions

 

 

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded


jack.pond at psitex

Aug 31, 2009, 1:07 PM

Post #1 of 8 (1084 views)
Permalink
Re: Replacing Newline using Extension:StringFunctions

Waseem etal,

I would like to modify Extension:StringFunctions to allow this.

This requested functionalit is useful in making it easier for users to
edit/create information in infoblocks without having to remember to put in
<br>

The end result would allow display (in a template) by using the extended
parser function "replace"

Example:

{{#replace:{{{Input String}}}|\n|<br>}}

Details on how this would be done are at:

http://www.mediawiki.org/wiki/Extension_talk:StringFunctions#re:_Replacing_N
ew_Lines.2C_Line_Breaks


Jack

> -----Original Message-----
> From: mediawiki-l-bounces [at] lists
> [mailto:mediawiki-l-bounces [at] lists] On Behalf Of
> Waseem Sayegh
> Sent: Tuesday, August 25, 2009 8:15 AM
> To: mediawiki-l [at] lists
> Subject: [Mediawiki-l] Replacing Newline
>
> How can you replace a newline with a line break? I tried
> {{#replace:{{{1}}}|\n|<br />}} but it doesn't seem to be
> picking up the '\n' at all. Is there a way, or even a workaround?
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


j.m.van.leerdam at gmail

Aug 31, 2009, 1:39 PM

Post #2 of 8 (1031 views)
Permalink
Re: Replacing Newline using Extension:StringFunctions [In reply to]

Hi,

2009/8/31 Jack D. Pond <jack.pond [at] psitex>:
> Waseem etal,
>
> I would like to modify Extension:StringFunctions to allow this.
>
> This requested functionalit is useful in making it easier for users to
> edit/create information in infoblocks without having to remember to put in
> <br>
>

I may be dense, but why do you need this in mediawiki? Using two
newlines results in a new paragraph when rendering; using a single
newline collapses the text into a single paragraph AFAIK.

The following wiki text:
--------
this is line 1
this is line 2

this is line 3 (extra newline)
this is line 4


this is line 5 (two extra newlines)
this is line 6
--------

renders as
-------
<p>this is line 1
this is line 2
</p><p>this is line 3 (extra newline)
this is line 4
</p><p><br />
this is line 5 (two extra newlines)
this is line 6
</p>
-------

--
Regards,

Jean-Marc
--
. ___
. @@ // \\ "De Chelonian Mobile"
. (_,\/ \_/ \ TortoiseSVN
. \ \_/_\_/> The coolest Interface to (Sub)Version Control
. /_/ \_\ http://tortoisesvn.net

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


jack.pond at psitex

Aug 31, 2009, 3:44 PM

Post #3 of 8 (1026 views)
Permalink
Re: Replacing Newline using Extension:StringFunctions [In reply to]

Extra newline also means extra line in output. More importantly, if a user
fills in either in infoblock or a textbox, they have to put the second
newline in - teaching the users to do this is as counterintuitive as
teaching them to put an html break (<br>).

However, escaping the escape (e.g., "\\" instead of "\") can be difficult
too - but usually not an issue for those who would actually put one in - and
the <nowiki> mechanism is already widely used for this.

Jack
> -----Original Message-----
> From: mediawiki-l-bounces [at] lists
> [mailto:mediawiki-l-bounces [at] lists] On Behalf Of
> Jean-Marc van Leerdam
> Sent: Monday, August 31, 2009 4:39 PM
> To: MediaWiki announcements and site admin list
> Subject: Re: [Mediawiki-l] Replacing Newline using
> Extension:StringFunctions
>
> Hi,
>
> 2009/8/31 Jack D. Pond <jack.pond [at] psitex>:
> > Waseem etal,
> >
> > I would like to modify Extension:StringFunctions to allow this.
> >
> > This requested functionalit is useful in making it easier
> for users to
> > edit/create information in infoblocks without having to remember to
> > put in <br>
> >
>
> I may be dense, but why do you need this in mediawiki? Using
> two newlines results in a new paragraph when rendering; using
> a single newline collapses the text into a single paragraph AFAIK.
>
> The following wiki text:
> --------
> this is line 1
> this is line 2
>
> this is line 3 (extra newline)
> this is line 4
>
>
> this is line 5 (two extra newlines)
> this is line 6
> --------
>
> renders as
> -------
> <p>this is line 1
> this is line 2
> </p><p>this is line 3 (extra newline)
> this is line 4
> </p><p><br />
> this is line 5 (two extra newlines)
> this is line 6
> </p>
> -------
>
> --
> Regards,
>
> Jean-Marc
> --
> . ___
> . @@ // \\ "De Chelonian Mobile"
> . (_,\/ \_/ \ TortoiseSVN
> . \ \_/_\_/> The coolest Interface to (Sub)Version Control
> . /_/ \_\ http://tortoisesvn.net
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


wsayegh at gmail

Aug 31, 2009, 9:05 PM

Post #4 of 8 (1015 views)
Permalink
Re: Replacing Newline using Extension:StringFunctions [In reply to]

Regarding what this would be used for, from my personal experience with
running http://www.shawshara.com inexperienced users or non tech-users tend
to edit the wiki thinking that a new line will automatically translate into
a line break. Some more experienced users with HTML knowledge have modified
our pages and have appended <br /> to the end of the lyrics lines. Both ways
are not valid. Now, I'm sure that most of you are techies so you're familiar
with how the wiki works, but think about it from the point of view of a
person that has never seen code.

We've been trying to make the site as user friendly as possible. To do so,
we're now in the processes of converting the whole site to use Semantic
Forms to allow users to easily edit a page's contents using a form instead
(ex:http://www.shawshara.com/wiki/Ya_Rayah click edit with form). With the
introduction of these forms we've learned that the way to go for us is not
to ask users to enter two new lines, but instead to handle this conversion
ourselves. At any rate, the Poem extension (
http://www.mediawiki.org/wiki/Extension:Poem) really does the trick for us.
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


wolkwitz at fh-swf

Aug 31, 2009, 10:56 PM

Post #5 of 8 (1020 views)
Permalink
Re: Replacing Newline using Extension:StringFunctions [In reply to]

Hi Jack,

I'm not sure if I really understand the wherefor and why but the break in
mediawiki is <br\> not <br>.

Perhaps you could make an extra button to insert <br/>?

Greetings
Katharina

Jack D. Pond schrieb am 01.09.2009 00:44:
> Extra newline also means extra line in output. More importantly, if a user
> fills in either in infoblock or a textbox, they have to put the second
> newline in - teaching the users to do this is as counterintuitive as
> teaching them to put an html break (<br>).
>
> However, escaping the escape (e.g., "\\" instead of "\") can be difficult
> too - but usually not an issue for those who would actually put one in - and
> the <nowiki> mechanism is already widely used for this.
>
> Jack
>> -----Original Message-----
>> From: mediawiki-l-bounces [at] lists
>> [mailto:mediawiki-l-bounces [at] lists] On Behalf Of
>> Jean-Marc van Leerdam
>> Sent: Monday, August 31, 2009 4:39 PM
>> To: MediaWiki announcements and site admin list
>> Subject: Re: [Mediawiki-l] Replacing Newline using
>> Extension:StringFunctions
>>
>> Hi,
>>
>> 2009/8/31 Jack D. Pond <jack.pond [at] psitex>:
>>> Waseem etal,
>>>
>>> I would like to modify Extension:StringFunctions to allow this.
>>>
>>> This requested functionalit is useful in making it easier
>> for users to
>>> edit/create information in infoblocks without having to remember to
>>> put in <br>
>>>
>> I may be dense, but why do you need this in mediawiki? Using
>> two newlines results in a new paragraph when rendering; using
>> a single newline collapses the text into a single paragraph AFAIK.
>>
>> The following wiki text:
>> --------
>> this is line 1
>> this is line 2
>>
>> this is line 3 (extra newline)
>> this is line 4
>>
>>
>> this is line 5 (two extra newlines)
>> this is line 6
>> --------
>>
>> renders as
>> -------
>> <p>this is line 1
>> this is line 2
>> </p><p>this is line 3 (extra newline)
>> this is line 4
>> </p><p><br />
>> this is line 5 (two extra newlines)
>> this is line 6
>> </p>
>> -------

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


Platonides at gmail

Sep 1, 2009, 2:58 AM

Post #6 of 8 (1009 views)
Permalink
Re: Replacing Newline using Extension:StringFunctions [In reply to]

Katharina Wolkwitz wrote:
> Hi Jack,
>
> I'm not sure if I really understand the wherefor and why but the break in
> mediawiki is <br\> not <br>.
>
> Perhaps you could make an extra button to insert <br/>?
>
> Greetings
> Katharina

You break paragraphs in MediaWiki using *two* line breaks.
<br /> or <br> force a line break just as it does in html, but you
/shouldn't/ need it.


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


Jon.G.Bartlett at gsk

Sep 1, 2009, 3:12 AM

Post #7 of 8 (1007 views)
Permalink
Re: Replacing Newline using Extension:StringFunctions [In reply to]

<br> is inserted by FCKEditor (which I guess many are using in their
Wikis).
Personally, I find these all over the place in oursi - and it irritaes me
(even in level heading, and tables etc)

Jon.



"Platonides" <Platonides [at] gmail>
Sent by: mediawiki-l-bounces [at] lists
01-Sep-2009 10:58
Please respond to "MediaWiki announcements and site admin list"
<mediawiki-l [at] lists>


To
mediawiki-l [at] lists
cc

Subject
Re: [Mediawiki-l] Replacing Newline using Extension:StringFunctions






Katharina Wolkwitz wrote:
> Hi Jack,
>
> I'm not sure if I really understand the wherefor and why but the break
in
> mediawiki is <br\> not <br>.
>
> Perhaps you could make an extra button to insert <br/>?
>
> Greetings
> Katharina

You break paragraphs in MediaWiki using *two* line breaks.
<br /> or <br> force a line break just as it does in html, but you
/shouldn't/ need it.


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l



-----------------------------------------------------------
This e-mail was sent by GlaxoSmithKline Services Unlimited
(registered in England and Wales No. 1047315), which is a
member of the GlaxoSmithKline group of companies. The
registered address of GlaxoSmithKline Services Unlimited
is 980 Great West Road, Brentford, Middlesex TW8 9GS.
-----------------------------------------------------------
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


jack.pond at psitex

Sep 1, 2009, 7:17 AM

Post #8 of 8 (1003 views)
Permalink
Re: Replacing Newline using Extension:StringFunctions [In reply to]

I think part of the point of usability with a wiki is to reduce user
complexity, not to increase it. Silly rules like adding a <br> or using two
line feeds (which sometimes shows up as two line feeds), run contrary to
that concept.

After seeing many responses (thank you all for the input), I've come to the
conclusion that this is best implemented by creating a new extension, which
I'm going to call ExtendedStringFunctions.

This will allow escaping characters (such as newline and others) and will be
invoked with an extra "e" at the end of the parser function:

Example:

{{#replacee:{{{Input String}}}|\n|<br>}}

This way, the existing users of StringFunctions will not find their stuff
unexpectedly escaped, and those who wish to do replacements and escaping can
do so with the extended functions.

Again, thanks for all the input!

Jack

> -----Original Message-----
> From: mediawiki-l-bounces [at] lists
> [mailto:mediawiki-l-bounces [at] lists] On Behalf Of
> Jon.G.Bartlett [at] gsk
> Sent: Tuesday, September 01, 2009 6:13 AM
> To: MediaWiki announcements and site admin list
> Subject: Re: [Mediawiki-l] Replacing Newline using
> Extension:StringFunctions
>
> <br> is inserted by FCKEditor (which I guess many are using
> in their Wikis).
> Personally, I find these all over the place in oursi - and it
> irritaes me (even in level heading, and tables etc)
>
> Jon.
>
>
>
> "Platonides" <Platonides [at] gmail>
> Sent by: mediawiki-l-bounces [at] lists
> 01-Sep-2009 10:58
> Please respond to "MediaWiki announcements and site admin list"
> <mediawiki-l [at] lists>
>
>
> To
> mediawiki-l [at] lists
> cc
>
> Subject
> Re: [Mediawiki-l] Replacing Newline using Extension:StringFunctions
>
>
>
>
>
>
> Katharina Wolkwitz wrote:
> > Hi Jack,
> >
> > I'm not sure if I really understand the wherefor and why
> but the break
> in
> > mediawiki is <br\> not <br>.
> >
> > Perhaps you could make an extra button to insert <br/>?
> >
> > Greetings
> > Katharina
>
> You break paragraphs in MediaWiki using *two* line breaks.
> <br /> or <br> force a line break just as it does in html,
> but you /shouldn't/ need it.
>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
>
>
> -----------------------------------------------------------
> This e-mail was sent by GlaxoSmithKline Services Unlimited
> (registered in England and Wales No. 1047315), which is a
> member of the GlaxoSmithKline group of companies. The
> registered address of GlaxoSmithKline Services Unlimited is
> 980 Great West Road, Brentford, Middlesex TW8 9GS.
> -----------------------------------------------------------
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.