URL highlighting text tinkering: Difference between revisions

From MWStake
Jump to navigation Jump to search
(Created page with "URLs to wikis can highlight sections of text using the pages '''URL''', followed by <code>#:~:text=</code>, followed by the '''URL encoded''' section of the text.")
 
No edit summary
Line 1: Line 1:
URLs to wikis can highlight sections of text using the pages '''URL''', followed by <code>#:~:text=</code>, followed by the '''URL encoded''' section of the text.
URLs to wikis can highlight sections of text using the pages '''URL''', followed by <code>#:~:text=</code>, followed by the '''URL encoded''' section of the text.
To build the link:
# Start with a normal external link bracket:
#* <code>[</code>
# Then add the pages URL, for example:
#* <code><nowiki>https://mwstake.org/mwstake/wiki/URL_highlighting_text_tinkering</nowiki></code>
# Add this little snippet:
#* <code>#:~:text=</code>
# Add the URL PATH encoded section of the text you want to highlight using <code>{<nowiki>{</nowiki>urlencode:string|PATH}}</code>
#* <code>{<nowiki>{</nowiki>urlencode:highlight sections of text|PATH}}</code>
#* Which results in:
#** {{urlencode:highlight sections of text|PATH}}
# 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:
#* <code>&nbsp; Cool highlighted link]</code>
# Putting this all together, you get:
#* <code>&#91;htt<nowiki>p</nowiki>s://mwstake.org/mwstake/wiki/URL_highlighting_text_tinkering#:~:text={<nowiki>{</nowiki>urlencode:highlight sections of text|PATH}} Cool tip]</code>
# Which results in (need to open in a new tab):
#* [https://mwstake.org/mwstake/wiki/URL_highlighting_text_tinkering#:~:text={{urlencode:highlight sections of text|PATH}} Cool tip]
[[Category:Wiki Moment]]

Revision as of 01:47, 3 June 2020

URLs to wikis can highlight sections of text using the pages URL, followed by #:~:text=, followed by 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):