URL highlighting text tinkering

From MWStake
Revision as of 20:13, 4 June 2020 by Bryandamon (talk | contribs)
Jump to navigation Jump to search

URLs to websites (including wikis) can highlight sections of text using the pages URL, followed by #:~:text=, and ending with the URL encoded section of the text.


To build the link:

  1. Start with a normal external link bracket:
    • [
  2. Then add the pages URL, for example:
    • https://mwstake.org/mwstake/wiki/URL_highlighting_text_tinkering
  3. Add this little snippet:
    • #:~:text=
  4. Add the URL PATH encoded section of the text you want to highlight using {{urlencode:string|PATH}}
    • {{urlencode:highlight sections of text|PATH}}
    • Which results in:
      • highlight%20sections%20of%20text
  5. Then finish with a space (normal for an external link), the alternative text (probably ideal since the URL will likely be long), and then a closing bracket:
    •   Cool highlighted link]
  6. Putting this all together, you get:
    • [https://mwstake.org/mwstake/wiki/URL_highlighting_text_tinkering#:~:text={{urlencode:highlight sections of text|PATH}} Cool tip]
  7. Which results in (need to open in a new tab):