• Home
  • Random
  • Recent changes
  • Special pages
  • Settings
  • About MOASSpedia
  • Disclaimers
MOASSpedia
  • 216.73.216.55
  • Talk
  • Watchlist
  • Contributions
  • Log in

Template:Format linkr

Template Discussion
  • Language
  • Watch
  • History
  • Edit
    • Page information
    • Permanent link
    • What links here
Template documentation[view] [edit] [history] [purge]
Shortcut
  • {{flr}}
This template uses Lua:
  • Module:Format link
  • Module:Urldecode

Contents

  • 1 Usage
    • 1.1 {{format link}}
    • 1.2 {{format linkr}}
      • 1.2.1 |nud=

Usage

This template does exactly what {{format link}} does, and takes all the same arguments.

This template is intended to lower editor workload when copying links from the URL bar and is not suitable for replacing {{format link}}, because of the changes it makes to {{format link}}'s output that could create ambiguity if automatically replaced.

This template replaces any underscores with spaces and decodes any URL parts in {{format link}}'s output. Some examples of why this may be useful—

{{format link}}

  • {{format link|People_of_the_Philippines_v._Santos,_Ressa_and_Rappler#Santos_Jr.'s_article|italicizepage=y}}
    People_of_the_Philippines_v._Santos,_Ressa_and_Rappler § Santos_Jr.'s_article
  • {{format link|%E6%9C%AA%E6%9D%A5%E6%97%A5%E8%A8%98#M%61nga}}
    %E6%9C%AA%E6%9D%A5%E6%97%A5%E8%A8%98 § M%61nga

{{format linkr}}

  • {{format linkr|People_of_the_Philippines_v._Santos,_Ressa_and_Rappler#Santos_Jr.'s_article|italicizepage=y}}
People of the Philippines v. Santos, Ressa and Rappler § Santos Jr.'s article
  • {{format linkr|%E6%9C%AA%E6%9D%A5%E6%97%A5%E8%A8%98#M%61nga}}
未来日記 § Manga
  • As shown in these examples, {{format linkr}} also creates a way to use curly braces in links, which requires multiple templates with {{format link}}:
    • {{hlist|{{format linkr|T#%7D}}|{{format linkr|#%7D}}}}
    • T § {{u}}
    • § {{u}}
    • {{hlist|{{format linkr|Template talk:T#%7B%7Bu%7D%7D}}|{{format linkr|#%7B%7Bu%7D%7D}}}}
    • Template talk:T § {{u}}
    • § {{u}}

|nud=

|nud= (no URL decode) can be added to disable URL decoding but still get underscores replaced.

  • {{format linkr|%E6%9C%AA%E6%9D%A5%E6%97%A5%E8%A8%98#M%61_nga|nud=y}}
%E6%9C%AA%E6%9D%A5%E6%97%A5%E8%A8%98 § M%61 nga

Note that you can achieve this through the HTML5 entity _ just as well:

  • {{format linkr|pages%5Fcan’t_contain_underscores#but%5Fsections_may (though their anchors won’t!)}}
pages can’t contain underscores § but sections_may (though their anchors won’t!)
The above documentation is transcluded from Template:Format linkr/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://moasspedia.org/w/index.php?title=Template:Format_linkr&oldid=16996"
Categories:
  • Lua-based templates
  • Internal link templates
Last edited on 1 January 2022, at 12:59

MOASSpedia

Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • This page was last edited on 1 January 2022, at 12:59.
  • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • Privacy policy
  • About MOASSpedia
  • Disclaimers
  • Desktop