|
Last change
on this file was
9865,
checked in by Ryan J Ollos, 13 years ago
|
|
Fix: for the case of an anchor with visible text, the visible text was being used in the href rather than the anchor id. Thank you peichman@… for the patch. Fixes #8413.
|
-
Property svn:keywords set to
LastChangedRevision HeadURL
|
|
File size:
611 bytes
|
| Rev | Line | |
|---|
| [9865] | 1 | # -*- coding: utf-8 -*- |
|---|
| 2 | """ |
|---|
| 3 | This macro allows you to add anchor. |
|---|
| 4 | |
|---|
| 5 | Author: Dmitri Khijniak |
|---|
| 6 | |
|---|
| 7 | Usage: |
|---|
| 8 | {{{ |
|---|
| 9 | [[Anchor(anchor_name,text )]] |
|---|
| 10 | }}} |
|---|
| 11 | or |
|---|
| 12 | {{{ |
|---|
| 13 | [[Anchor(anchor_name)]] |
|---|
| 14 | }}} |
|---|
| 15 | Where: |
|---|
| 16 | anchor_name:: |
|---|
| 17 | is a URL used to reference the anchor |
|---|
| 18 | text:: |
|---|
| 19 | visible text describing the anchor |
|---|
| 20 | |
|---|
| 21 | Example: |
|---|
| 22 | {{{ |
|---|
| 23 | [[Anchor(anchor)]] |
|---|
| 24 | [[Anchor(anchor, name)]] |
|---|
| 25 | }}} |
|---|
| 26 | """ |
|---|
| 27 | |
|---|
| 28 | def execute(hdf, args, env): |
|---|
| 29 | args = tuple(args.split(",")) |
|---|
| 30 | print args |
|---|
| 31 | if len(args) == 2: |
|---|
| 32 | return '<a name="%s" href="#%s">%s</a>' % (args[0],args[0],args[1]) |
|---|
| 33 | else: |
|---|
| 34 | return '<a name="%s"></a>' % args |
|---|
Note: See
TracBrowser
for help on using the repository browser.