diff options
author | Unknwon <joe2010xtmf@163.com> | 2015-02-06 19:15:58 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2015-02-06 19:15:58 -0500 |
commit | 066989722626deb9e0de1ea0cbe158aa387d8d26 (patch) | |
tree | d37d897c11298c6134d4e430542e9a76c135a9b3 | |
parent | ddddad9792d203c3ac3e6406aac0bf38235018dd (diff) | |
download | gitea-066989722626deb9e0de1ea0cbe158aa387d8d26.tar.gz gitea-066989722626deb9e0de1ea0cbe158aa387d8d26.zip |
modules/base: fix markdown mention regex for #826
- conf/locale: add mew translator profile
-rw-r--r-- | conf/locale/TRANSLATORS | 1 | ||||
-rw-r--r-- | gogs.go | 2 | ||||
-rw-r--r-- | modules/base/markdown.go | 2 | ||||
-rw-r--r-- | public/ng/css/gogs.css | 6 | ||||
-rw-r--r-- | public/ng/less/gogs/markdown.less | 167 | ||||
-rw-r--r-- | templates/.VERSION | 2 |
6 files changed, 92 insertions, 88 deletions
diff --git a/conf/locale/TRANSLATORS b/conf/locale/TRANSLATORS index 6c72f3342a..4cd8bf6a4e 100644 --- a/conf/locale/TRANSLATORS +++ b/conf/locale/TRANSLATORS @@ -3,6 +3,7 @@ Akihiro YAGASAKI <yaggytter@momiage.com> Christoph Kisfeld <christoph.kisfeld@gmail.com> +Huimin Wang <wanghm2009@hotmail.co.jp> Thomas Fanninger <gogs.thomas@fanninger.at> Ćukasz Jan Niemier <lukasz@niemier.pl> Lafriks <lafriks@gmail.com> @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.5.12.0204 Beta" +const APP_VER = "0.5.12.0206 Beta" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/modules/base/markdown.go b/modules/base/markdown.go index 87aafda3e1..4122098618 100644 --- a/modules/base/markdown.go +++ b/modules/base/markdown.go @@ -106,7 +106,7 @@ func (options *CustomRender) Image(out *bytes.Buffer, link []byte, title []byte, } 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-]*)?`) issueFullPattern = regexp.MustCompile(`(\s|^)https?.*issues/[0-9]+(#+[0-9a-zA-Z-]*)?`) issueIndexPattern = regexp.MustCompile(`( |^)#[0-9]+`) diff --git a/public/ng/css/gogs.css b/public/ng/css/gogs.css index cf2b021dfc..1db8ee6972 100644 --- a/public/ng/css/gogs.css +++ b/public/ng/css/gogs.css @@ -364,6 +364,9 @@ img.avatar-100 { .markdown table tr:nth-child(2n) { background-color: #F8F8F8; } +.markdown p { + margin: 20px 0; +} .markdown a { color: #428BCA; } @@ -448,9 +451,6 @@ img.avatar-100 { margin: 15px 0; border-bottom: 2px solid #EEE; } -.markdown p { - margin: 20px 0; -} .markdown blockquote:last-child, .markdown ul:last-child, .markdown ol:last-child, diff --git a/public/ng/less/gogs/markdown.less b/public/ng/less/gogs/markdown.less index e3abb480a2..cd2eef99bc 100644 --- a/public/ng/less/gogs/markdown.less +++ b/public/ng/less/gogs/markdown.less @@ -1,88 +1,91 @@ .markdown { - background-color: white; - font-size: 16px; - line-height: 24px; - .markdown-body { - padding-left: 24px; - padding-right: 16px; - } - h5, - h6 { - font-size: 1em; - } - ul { - padding: 10px 0 0 15px; - li { - list-style: inside; - } - } - ol li { - list-style: decimal inside; - } + background-color: white; + font-size: 16px; + line-height: 24px; + .markdown-body { + padding-left: 24px; + padding-right: 16px; + } + h5, + h6 { + font-size: 1em; + } + ul { + padding: 10px 0 0 15px; li { - line-height: 1.6; - margin-top: 6px; - &:first-child { - margin-top: 0; - } - } + list-style: inside; + } + } + 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 { - 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 { - padding: 0; - background-color: inherit; - } - } - img { - padding: 10px 0; - max-width: 100%; - } - blockquote { - border-left: 4px solid #ddd; - margin-bottom: 16px; - p { - font-size: 14px; - padding: 5px 15px; - color: #777; - } - } - table { - display: block; - width: 100%; - overflow: auto; - word-break: normal; - 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; - } - } - } + padding: 0; + background-color: inherit; + } + } + img { + padding: 10px 0; + max-width: 100%; + } + blockquote { + border-left: 4px solid #ddd; + margin-bottom: 16px; + p { + font-size: 14px; + padding: 5px 15px; + color: #777; + } + } + table { + display: block; + width: 100%; + overflow: auto; + word-break: normal; + 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 { color: #428BCA; diff --git a/templates/.VERSION b/templates/.VERSION index 40246b9eca..99de7de73e 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.5.12.0204 Beta
\ No newline at end of file +0.5.12.0206 Beta
\ No newline at end of file |