Changes between Version 5 and Version 6 of TracLinks
- Timestamp:
- 09/05/24 06:48:15 (2 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracLinks
v5 v6 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 150 156 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. 151 157 152 To create a link to the first or last occurrence of a term on a page, use a ''pseudo anchor'' starting with '#/' or '#?':158 To create a link to the first or last occurrence of a term on a page, use a ''pseudo anchor'' starting with `#/` or `#?`: 153 159 {{{ 154 160 [#/Milestone first occurrence of Milestone] or … … 157 163 [#/Milestone first occurrence of Milestone] or 158 164 [#?Milestone last occurrence of Milestone] 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':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`: 160 166 {{{ 161 167 [#/Milestone/i first occurrence of Milestone or milestone] or … … 176 182 (Hint: The line numbers displayed in the source browser are links to anchors on the respective lines.) 177 183 178 Since such links become outdated when the file changes, it can be useful to link using a '#/'pseudo anchor instead:184 Since such links become outdated when the file changes, it can be useful to link using a `#/` pseudo anchor instead: 179 185 {{{ 180 186 [trac:source:trunk/trac/wiki/api.py#/IWikiSyntaxProvider IWikiSyntaxProvider] or … … 269 275 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:`. 270 276 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.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. 272 278 273 279 See also [#export:links].