Search code examples
urlanchorurl-scheme

URL 'Text fragments' with 'anchor'


Browsing, for example, on this page from a mobile browser (Opera), all sections are closed, so you need to open its anchor to see that paragraph. Now, how to highlight the title, Dettagli molecolari del C3, of that section with text fragments?

In general, is it possible to use an anchor together with text fragments?

I tried (without success):

https://it.wikipedia.org/wiki/Sistema_del_complemento#:~:text=Dettagli%20molecolari%20del%20C3

or:

https://it.wikipedia.org/wiki/Sistema_del_complemento#Dettagli_molecolari_del_C3:~:text=Dettagli%20molecolari%20del%20C3

or:

https://it.wikipedia.org/wiki/Sistema_del_complemento#Dettagli_molecolari_del_C3&text=Dettagli%20molecolari%20del%20C3


Solution

  • You'll need to use prefix- and -suffix to delineate a specific instance of the text

    https://it.wikipedia.org/wiki/Sistema_del_complemento#Dettagli_molecolari_del_C3:~:text=via%20alternativa-,Dettagli%20molecolari%20del%20C3,-%5Bmodifica

    (You can copy & paste that but clicking it won't work here because links have to include rel="noopener", which SO won't allow me to add. Oddly, the link works only when composing/editing this answer.)

    Chrome and Edge now have Copy to link highlight in the right-click context menu that creates a link with the text fragment.