Template talk:Urltowiki

(Redirected from Template talk:Urltowiki/testcases)
Latest comment: 1 year ago by Hairy Dude in topic Special:MobileDiff
edit

Remove redundant piped text

edit

Currently {{subst:urltowiki|https://en.wikipedia.org/wiki/Example|Example}} results in [[Example|Example]], which is redundant and confusing. It seems like it would be easy for the module to check if the display and page title are the same, and if so, only include the page title. I think it would entail switching line 188 from

        if display then

to

        if display and display ~= wikitext then

(I would add it myself, but I'm not confident in my Lua skills.) Thanks, /~huesatlum/ 15:09, 27 July 2015 (UTC)Reply

@HueSatLum: Very good point! I've fixed it. — Mr. Stradivarius ♪ talk ♪ 08:29, 28 July 2015 (UTC)Reply

error=no?

edit

@Ahecht: When would error=no ever be useful or desirable? Jackmcbarn (talk) 17:54, 28 August 2015 (UTC)Reply

I was just thinking the same thing. Ahecht, what is your use-case here? I'm guessing that there's probably an easier way of doing whatever you're trying to do. — Mr. Stradivarius ♪ talk ♪ 20:22, 28 August 2015 (UTC)Reply
@Jackmcbarn: The template already gracefully handles other input options, either a valid URL or a non-URL string, so this lets it gracefully handle a missing input if desired. This is similar to the |ignore_errors=1 parameter in module:String. One example where it came in handy is in {{Request redirect/post}}, where I want a blank input to result in a blank output. I could add a statement such as {{safesubst<noinclude/>:#if{{{input|}}}|{{safesubst<noinclude/>:u2w|{{{input}}}}}|}}, but it seemed cleaner this way. I suppose, for consistences sake, I should've used ignore_errors=1 instead of error=no (I can change it if you like) --Ahecht (TALK
PAGE
) 04:19, 29 August 2015 (UTC)Reply
If you're accessing Module:UrlToWiki from a Lua module, then you can just use pcall rather than having to change the module itself. #iferror will work from templates as well, although the page will be categorised into Category:Pages with script errors. To avoid the categorisation when calling it from wikitext, we could add another function to the module that is routed through pcall. That would at least avoid the need for if/then blocks to check for errors. — Mr. Stradivarius ♪ talk ♪ 07:24, 29 August 2015 (UTC)Reply
Since the template is being substituted rather than transcluded in that use case, the page won't end up in Category:Pages with script errors no matter what, so no extra logic for that will be needed. Jackmcbarn (talk) 16:01, 29 August 2015 (UTC)Reply

Requested move 30 October 2019

edit
The following is a closed discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. Editors desiring to contest the closing decision should consider a move review after discussing it on the closer's talk page. No further edits should be made to this discussion.

The result of the move request was: Moved (closed by non-admin page mover) Wug·a·po·des05:04, 8 November 2019 (UTC)Reply


– Match name with template. * Pppery * it has begun... 21:57, 30 October 2019 (UTC)Reply


The above discussion is preserved as an archive of a requested move. Please do not modify it. Subsequent comments should be made in a new section on this talk page or in a move review. No further edits should be made to this section.

Special:MobileDiff

edit

For whatever reason, diffs are displayed in the mobile interface not using the regular diff but via this special page. Can this template support it, for the benefit of mobile users? Hairy Dude (talk) 20:51, 29 December 2022 (UTC)Reply