示例#1
0
文件: text.py 项目: pyzh/mikoto
def render_markdown_with_team(content, team):
    text = render_markdown(content)
    text = re.sub(
        RE_TICKET,
        r'<a href="' + team.url + r'issues/\1/" class="issue-link">#\1</a>',
        text)
    return parse_emoji(text, is_escape=False)
示例#2
0
文件: text.py 项目: pyzh/mikoto
def render_commit_message(message, project):
    text = parse_emoji(message)
    text = re.sub(RE_PR_IN_MESSAGE,
                  r' <a href="/%s/newpull/\1">#\1</a> ' % project.name, text)
    text = re.sub(RE_ISSUE_IN_MESSAGE,
                  r' <a href="/%s/issues/\1">#\1</a> ' % project.name, text)
    text = text.decode('utf8')
    return text
示例#3
0
文件: text.py 项目: dm04806/mikoto
def render_commit_message(message, project):
    text = parse_emoji(message)
    text = re.sub(RE_PR_IN_MESSAGE,
                  r' <a href="/%s/newpull/\1">#\1</a> ' % project.name,
                  text)
    text = re.sub(RE_ISSUE_IN_MESSAGE,
                  r' <a href="/%s/issues/\1">#\1</a> ' % project.name,
                  text)
    text = text.decode('utf8')
    return text
示例#4
0
文件: text.py 项目: dm04806/mikoto
 def postprocess(self, text):
     if not text:
         return text
     text = render_checklist(text)
     text = parse_emoji(text, is_escape=False)
     return RE_USER_MENTION.sub(USER_LINK_TEXT, text)
示例#5
0
文件: text.py 项目: dm04806/mikoto
def render_markdown_with_team(content, team):
    text = render_markdown(content)
    text = re.sub(RE_TICKET, r'<a href="' + team.url +
                  r'issues/\1/" class="issue-link">#\1</a>', text)
    return parse_emoji(text, is_escape=False)
示例#6
0
 def postprocess(self, text):
     if not text:
         return text
     text = render_checklist(text)
     text = parse_emoji(text, is_escape=False)
     return RE_USER_MENTION.sub(USER_LINK_TEXT, text)