mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	modules/base: fix markdown mention regex for #826
- conf/locale: add mew translator profile
This commit is contained in:
		@@ -3,6 +3,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Akihiro YAGASAKI <yaggytter@momiage.com>
 | 
					Akihiro YAGASAKI <yaggytter@momiage.com>
 | 
				
			||||||
Christoph Kisfeld <christoph.kisfeld@gmail.com>
 | 
					Christoph Kisfeld <christoph.kisfeld@gmail.com>
 | 
				
			||||||
 | 
					Huimin Wang <wanghm2009@hotmail.co.jp>
 | 
				
			||||||
Thomas Fanninger <gogs.thomas@fanninger.at>
 | 
					Thomas Fanninger <gogs.thomas@fanninger.at>
 | 
				
			||||||
Łukasz Jan Niemier <lukasz@niemier.pl>
 | 
					Łukasz Jan Niemier <lukasz@niemier.pl>
 | 
				
			||||||
Lafriks <lafriks@gmail.com>
 | 
					Lafriks <lafriks@gmail.com>
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								gogs.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								gogs.go
									
									
									
									
									
								
							@@ -17,7 +17,7 @@ import (
 | 
				
			|||||||
	"github.com/gogits/gogs/modules/setting"
 | 
						"github.com/gogits/gogs/modules/setting"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const APP_VER = "0.5.12.0204 Beta"
 | 
					const APP_VER = "0.5.12.0206 Beta"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	runtime.GOMAXPROCS(runtime.NumCPU())
 | 
						runtime.GOMAXPROCS(runtime.NumCPU())
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -106,7 +106,7 @@ func (options *CustomRender) Image(out *bytes.Buffer, link []byte, title []byte,
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var (
 | 
					var (
 | 
				
			||||||
	MentionPattern     = regexp.MustCompile(`(\s@)[0-9a-zA-Z_]{1,}`)
 | 
						MentionPattern     = regexp.MustCompile(`((^|\s)@)[0-9a-zA-Z_]{1,}`)
 | 
				
			||||||
	commitPattern      = regexp.MustCompile(`(\s|^)https?.*commit/[0-9a-zA-Z]+(#+[0-9a-zA-Z-]*)?`)
 | 
						commitPattern      = regexp.MustCompile(`(\s|^)https?.*commit/[0-9a-zA-Z]+(#+[0-9a-zA-Z-]*)?`)
 | 
				
			||||||
	issueFullPattern   = regexp.MustCompile(`(\s|^)https?.*issues/[0-9]+(#+[0-9a-zA-Z-]*)?`)
 | 
						issueFullPattern   = regexp.MustCompile(`(\s|^)https?.*issues/[0-9]+(#+[0-9a-zA-Z-]*)?`)
 | 
				
			||||||
	issueIndexPattern  = regexp.MustCompile(`( |^)#[0-9]+`)
 | 
						issueIndexPattern  = regexp.MustCompile(`( |^)#[0-9]+`)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -364,6 +364,9 @@ img.avatar-100 {
 | 
				
			|||||||
.markdown table tr:nth-child(2n) {
 | 
					.markdown table tr:nth-child(2n) {
 | 
				
			||||||
  background-color: #F8F8F8;
 | 
					  background-color: #F8F8F8;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					.markdown p {
 | 
				
			||||||
 | 
					  margin: 20px 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
.markdown a {
 | 
					.markdown a {
 | 
				
			||||||
  color: #428BCA;
 | 
					  color: #428BCA;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -448,9 +451,6 @@ img.avatar-100 {
 | 
				
			|||||||
  margin: 15px 0;
 | 
					  margin: 15px 0;
 | 
				
			||||||
  border-bottom: 2px solid #EEE;
 | 
					  border-bottom: 2px solid #EEE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
.markdown p {
 | 
					 | 
				
			||||||
    margin: 20px 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
.markdown blockquote:last-child,
 | 
					.markdown blockquote:last-child,
 | 
				
			||||||
.markdown ul:last-child,
 | 
					.markdown ul:last-child,
 | 
				
			||||||
.markdown ol:last-child,
 | 
					.markdown ol:last-child,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,88 +1,91 @@
 | 
				
			|||||||
.markdown {
 | 
					.markdown {
 | 
				
			||||||
    background-color: white;
 | 
					  background-color: white;
 | 
				
			||||||
    font-size: 16px;
 | 
					  font-size: 16px;
 | 
				
			||||||
    line-height: 24px;
 | 
					  line-height: 24px;
 | 
				
			||||||
    .markdown-body {
 | 
					  .markdown-body {
 | 
				
			||||||
        padding-left: 24px;
 | 
					    padding-left: 24px;
 | 
				
			||||||
        padding-right: 16px;
 | 
					    padding-right: 16px;
 | 
				
			||||||
    }
 | 
					  }
 | 
				
			||||||
    h5,
 | 
					  h5,
 | 
				
			||||||
    h6 {
 | 
					  h6 {
 | 
				
			||||||
        font-size: 1em;
 | 
					    font-size: 1em;
 | 
				
			||||||
    }
 | 
					  }
 | 
				
			||||||
    ul {
 | 
					  ul {
 | 
				
			||||||
        padding: 10px 0 0 15px;
 | 
					    padding: 10px 0 0 15px;
 | 
				
			||||||
        li {
 | 
					 | 
				
			||||||
            list-style: inside;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    ol li {
 | 
					 | 
				
			||||||
        list-style: decimal inside;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    li {
 | 
					    li {
 | 
				
			||||||
        line-height: 1.6;
 | 
					      list-style: inside;
 | 
				
			||||||
        margin-top: 6px;
 | 
					 | 
				
			||||||
        &:first-child {
 | 
					 | 
				
			||||||
            margin-top: 0;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  ol li {
 | 
				
			||||||
 | 
					    list-style: decimal inside;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  li {
 | 
				
			||||||
 | 
					    line-height: 1.6;
 | 
				
			||||||
 | 
					    margin-top: 6px;
 | 
				
			||||||
 | 
					    &:first-child {
 | 
				
			||||||
 | 
					        margin-top: 0;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  code {
 | 
				
			||||||
 | 
					    padding: 0.2em 0.5em;
 | 
				
			||||||
 | 
					    margin: 0;
 | 
				
			||||||
 | 
					    background-color: rgba(0,0,0,0.04);
 | 
				
			||||||
 | 
					    border-radius: 3px;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  >pre {
 | 
				
			||||||
 | 
					    font-size: 14px;
 | 
				
			||||||
 | 
					    line-height: 1.6;
 | 
				
			||||||
 | 
					    overflow: auto;
 | 
				
			||||||
 | 
					    border: 1px solid #ddd;
 | 
				
			||||||
 | 
					    border-radius: .25em;
 | 
				
			||||||
 | 
					    margin: 5px 0;
 | 
				
			||||||
 | 
					    padding: 10px;
 | 
				
			||||||
 | 
					    background-color: #f8f8f8;
 | 
				
			||||||
    code {
 | 
					    code {
 | 
				
			||||||
        padding: 0.2em 0.5em;
 | 
					      padding: 0;
 | 
				
			||||||
        margin: 0;
 | 
					      background-color: inherit;
 | 
				
			||||||
        background-color: rgba(0,0,0,0.04);
 | 
					 | 
				
			||||||
        border-radius: 3px;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    >pre {
 | 
					  }
 | 
				
			||||||
        font-size: 14px;
 | 
					  img {
 | 
				
			||||||
        line-height: 1.6;
 | 
					    padding: 10px 0;
 | 
				
			||||||
        overflow: auto;
 | 
					    max-width: 100%;
 | 
				
			||||||
        border: 1px solid #ddd;
 | 
					  }
 | 
				
			||||||
        border-radius: .25em;
 | 
					  blockquote {
 | 
				
			||||||
        margin: 5px 0;
 | 
					    border-left: 4px solid #ddd;
 | 
				
			||||||
        padding: 10px;
 | 
					    margin-bottom: 16px;
 | 
				
			||||||
        background-color: #f8f8f8;
 | 
					    p {
 | 
				
			||||||
        code {
 | 
					      font-size: 14px;
 | 
				
			||||||
            padding: 0;
 | 
					      padding: 5px 15px;
 | 
				
			||||||
            background-color: inherit;
 | 
					      color: #777;
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    img {
 | 
					  }
 | 
				
			||||||
        padding: 10px 0;
 | 
					  table {
 | 
				
			||||||
        max-width: 100%;
 | 
					    display: block;
 | 
				
			||||||
 | 
					    width: 100%;
 | 
				
			||||||
 | 
					    overflow: auto;
 | 
				
			||||||
 | 
					    word-break: normal;
 | 
				
			||||||
 | 
					    margin: 15px 0;
 | 
				
			||||||
 | 
					    border-collapse: collapse;
 | 
				
			||||||
 | 
					    border-spacing: 0;
 | 
				
			||||||
 | 
					    display: block;
 | 
				
			||||||
 | 
					    th {
 | 
				
			||||||
 | 
					      font-weight: 700;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    blockquote {
 | 
					    th, td {
 | 
				
			||||||
        border-left: 4px solid #ddd;
 | 
					      border: 1px solid #DDD;
 | 
				
			||||||
        margin-bottom: 16px;
 | 
					      padding: 6px 13px !important;
 | 
				
			||||||
        p {
 | 
					 | 
				
			||||||
            font-size: 14px;
 | 
					 | 
				
			||||||
            padding: 5px 15px;
 | 
					 | 
				
			||||||
            color: #777;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    table {
 | 
					    tr {
 | 
				
			||||||
        display: block;
 | 
					      background-color: #FFF;
 | 
				
			||||||
        width: 100%;
 | 
					      border-top: 1px solid #CCC;
 | 
				
			||||||
        overflow: auto;
 | 
					      &:nth-child(2n) {
 | 
				
			||||||
        word-break: normal;
 | 
					          background-color: #F8F8F8;
 | 
				
			||||||
        margin: 15px 0;
 | 
					      }
 | 
				
			||||||
        border-collapse: collapse;
 | 
					 | 
				
			||||||
        border-spacing: 0;
 | 
					 | 
				
			||||||
        display: block;
 | 
					 | 
				
			||||||
        th {
 | 
					 | 
				
			||||||
            font-weight: 700;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        th, td {
 | 
					 | 
				
			||||||
            border: 1px solid #DDD;
 | 
					 | 
				
			||||||
            padding: 6px 13px !important;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        tr {
 | 
					 | 
				
			||||||
            background-color: #FFF;
 | 
					 | 
				
			||||||
            border-top: 1px solid #CCC;
 | 
					 | 
				
			||||||
            &:nth-child(2n) {
 | 
					 | 
				
			||||||
                background-color: #F8F8F8;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  p {
 | 
				
			||||||
 | 
					     margin: 20px 0;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
.markdown a {
 | 
					.markdown a {
 | 
				
			||||||
    color: #428BCA;
 | 
					    color: #428BCA;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1 +1 @@
 | 
				
			|||||||
0.5.12.0204 Beta
 | 
					0.5.12.0206 Beta
 | 
				
			||||||
		Reference in New Issue
	
	Block a user