[Trac-tickets] [The Trac Project] #1755: Allow lhref without argument

The Trac Project noreply at edgewall.com
Wed Jul 6 02:35:04 CDT 2005


#1755: Allow lhref without argument
-------------------------+--------------------------------------------------
       Id:  1755         |      Status:  new                               
Component:  wiki         |    Modified:  Wed Jul  6 02:35:04 2005          
 Severity:  enhancement  |   Milestone:                                    
 Priority:  normal       |     Version:  none                              
    Owner:  jonas        |    Reporter:  Shun-ichi Goto <gotoh at taiyo.co.jp>
-------------------------+--------------------------------------------------
 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)
 }}}

-- 
Ticket URL: <http://projects.edgewall.com/trac/ticket/1755>
The Trac Project <>


More information about the Trac-Tickets mailing list