Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 17 years ago

#1755 closed enhancement (fixed)

Allow lhref without argument

Reported by: Shun-ichi Goto <gotoh@…> 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 Christian Boos, 19 years ago

Owner: changed from Jonas Borgström to Christian Boos
Status: newassigned

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

[wiki:ISO9000]ISO9000

comment:2 by Christian Boos, 19 years ago

Resolution: fixed
Status: assignedclosed

Applied in r1907, thanks!

comment:3 by Christian Boos, 17 years ago

Milestone: 0.9

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.