[bring markup closer to wikicreole draft spec raph.levien@gmail.com**20061228005139] { hunk ./barghest.py 275 -def userlink(ctx, uname): +def userlink(ctx, uname, body = None): hunk ./barghest.py 281 - return '' + htmlquote(realname) + '' + if body == None: + body = realname + return '' + htmlquote(body) + '' hunk ./barghest.py 321 -def wikihref(ctx, page): +# Determine URL for given wiki resource +def wikiurl(ctx, page): hunk ./barghest.py 330 - url_re = re.compile(r'^([a-z\+]*://\S+)(\s(.+))?') - m = url_re.match(str) - if m: - if m.group(3): - text = m.group(3) - else: - text = m.group(1) - return '' + htmlquote(text) + '' - if re.match('user/', str): - return userlink(ctx, str[5:]) - if exists or (exists == None and wikiexists(ctx, str)): - pref = '' + textstr + '' + if exists or (exists == None and wikiexists(ctx, str)): + aclass = 'class="wiki" ' + else: + aclass = 'class="new" ' + if str == '' and body == None: + body = 'wiki home page' + url = wikiurl(ctx, link) + if body == None: + body = link + return '' + htmlquote(body) + '' hunk ./barghest.py 371 - head_re = re.compile(r'\s*(=+)\s*') - special_re = re.compile(r'[<>&\\]|--|(?&\\]|--|(?
  • ') + pos = m.end() hunk ./barghest.py 440 - if mend < len(line) and line[mend] in '\\_#[]*': + if mend < len(line) and line[mend] in '\\_#[]*-/': hunk ./barghest.py 481 - ctx.write(['
    Edit') + items.append('Edit') }