Modify ↓
#1755 closed enhancement (fixed)
Allow lhref without argument
| Reported by: | Owned by: | Christian Boos | |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.9 |
| Component: | wiki system | Version: | none |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
I propose the enhancement of the lhref syntax on wiki formatting.
For example, new expression like [wiki:pagename] is
equivalent to [wiki:pagename pagename].
Thr reason of this enhancement is… Japanese users want to use wiki-pagename with kanji
characters and kanji character doesn't have upper/lower variation, thus we should type
same word twice on every entries like [wiki:pagename pagename].
I beleve that this syntax (using 'ltgt' part as 'label') is reasonable.
## Yes, Wikiname is not so grateful in kanji (CJK) document.
Index: formatter.py
===================================================================
--- formatter.py (revision 1906)
+++ formatter.py (working copy)
@@ -138,7 +138,7 @@
r"(?P<inlinecode2>!?`(?P<inline2>.*?)`)",
r"(?P<htmlescapeentity>!?&#\d+;)"]
_post_rules = [r"(?P<shref>!?((?P<sns>\w+):(?P<stgt>'[^']+'|((\|(?=[^| ])|[^| ])*[^|'~_\., \)]))))",
- r"(?P<lhref>!?\[(?P<lns>\w+):(?P<ltgt>[^ ]+) (?P<label>.*?)\])",
+ r"(?P<lhref>!?\[(?P<lns>\w+):(?P<ltgt>[^\] ]+)(?: (?P<label>.*?))?\])",
r"(?P<macro>!?\[\[(?P<macroname>[\w/+-]+)(\]\]|\((?P<macroargs>.*?)\)\]\]))",
r"(?P<heading>^\s*(?P<hdepth>=+)\s.*\s(?P=hdepth)\s*$)",
r"(?P<list>^(?P<ldepth>\s+)(?:\*|\d+\.) )",
@@ -278,6 +278,6 @@
def _lhref_formatter(self, match, fullmatch):
ns = fullmatch.group('lns')
target = fullmatch.group('ltgt')
- label = fullmatch.group('label')
+ label = fullmatch.group('label') or fullmatch.group('ltgt')
if ns in self.link_resolvers:
return self._link_resolvers[ns](self, ns, target, label)
Attachments (0)
Change History (3)
comment:1 by , 20 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 19 years ago
| Milestone: | → 0.9 |
|---|
Note:
See TracTickets
for help on using tickets.



Looks good, and will be also useful for wiki pages names that don't match the WikiPageNames rules, e.g.:
[wiki:ISO9000]→ ISO9000