Changes between Version 6 and Version 7 of TracLinks
- Timestamp:
- Sep 8, 2024, 12:14:12 PM (3 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracLinks
v6 v7 142 142 === Link anchors 143 143 144 To create a link to a specific anchor in a page, use `#`:144 To create a link to a specific anchor in a page, use '#': 145 145 {{{ 146 146 [#Linkanchors Link anchors] or [[#Linkanchors|Link anchors]] … … 148 148 [#Linkanchors Link anchors] or [[#Linkanchors|Link anchors]] 149 149 150 To create an anchor in a page, use `[=#...]`:151 {{{152 [=#myanchor my anchor] or empty form [=#myanchor]153 }}}154 [=#myanchor my anchor] or empty form [=#myanchor]155 156 150 Hint: when you hover your mouse over the title of a section, a '¶' character will be displayed. This is a link to that specific section and you can use this to copy the `#...` part inside a relative link to an anchor. 157 151 158 To create a link to the first or last occurrence of a term on a page, use a ''pseudo anchor'' starting with `#/` or `#?`:152 To create a link to the first or last occurrence of a term on a page, use a ''pseudo anchor'' starting with '#/' or '#?': 159 153 {{{ 160 154 [#/Milestone first occurrence of Milestone] or … … 163 157 [#/Milestone first occurrence of Milestone] or 164 158 [#?Milestone last occurrence of Milestone] 165 This will also highlight all other matches on the linked page. By default only case sensitive matches are considered. To include case insensitive matches append `/i`:159 This will also highlight all other matches on the linked page. By default only case sensitive matches are considered. To include case insensitive matches append '/i': 166 160 {{{ 167 161 [#/Milestone/i first occurrence of Milestone or milestone] or … … 182 176 (Hint: The line numbers displayed in the source browser are links to anchors on the respective lines.) 183 177 184 Since such links become outdated when the file changes, it can be useful to link using a `#/`pseudo anchor instead:178 Since such links become outdated when the file changes, it can be useful to link using a '#/' pseudo anchor instead: 185 179 {{{ 186 180 [trac:source:trunk/trac/wiki/api.py#/IWikiSyntaxProvider IWikiSyntaxProvider] or … … 275 269 If you'd like to create a direct link to the content of the attached file instead of a link to the attachment page, simply use `raw-attachment:` instead of `attachment:`. 276 270 277 This can be useful for pointing directly to an HTML document, for example. Note that for this use case, you'd have to allow the web browser to render the content by setting [[TracIni#attachment-render_unsafe_content-option|"[attachment] render_unsafe_content"]] = `enabled`. Caveat: only do that in environments for which you're 100% confident you can trust the people who are able to attach files, as this opens up your site to [ https://en.wikipedia.org/wiki/Cross-site_scripting cross-site scripting] attacks.271 This can be useful for pointing directly to an HTML document, for example. Note that for this use case, you'd have to allow the web browser to render the content by setting [[TracIni#attachment-render_unsafe_content-option|"[attachment] render_unsafe_content"]] = `enabled`. Caveat: only do that in environments for which you're 100% confident you can trust the people who are able to attach files, as this opens up your site to [wikipedia:Cross-site_scripting cross-site scripting] attacks. 278 272 279 273 See also [#export:links].