]> source.dussan.org Git - gitea.git/commitdiff
modules/base: fix markdown mention regex for #826
authorUnknwon <joe2010xtmf@163.com>
Sat, 7 Feb 2015 00:15:58 +0000 (19:15 -0500)
committerUnknwon <joe2010xtmf@163.com>
Sat, 7 Feb 2015 00:15:58 +0000 (19:15 -0500)
- conf/locale: add mew translator profile

conf/locale/TRANSLATORS
gogs.go
modules/base/markdown.go
public/ng/css/gogs.css
public/ng/less/gogs/markdown.less
templates/.VERSION

index 6c72f3342ac5f7de9574963fbf04fb59565afbc9..4cd8bf6a4e86c003ca0bd59bbfc3bd5b3c3ec165 100644 (file)
@@ -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>
diff --git a/gogs.go b/gogs.go
index 5e69bd68e59abdb48a47d48569b5ab69013ec0f9..ce524af5aa725f0b3782c08e0961ce460c351cfe 100644 (file)
--- a/gogs.go
+++ b/gogs.go
@@ -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())
index 87aafda3e1e7ae1178afb8ba2676b52b5458a118..41220986182dcafc3c29d9c810a7226b8b144f55 100644 (file)
@@ -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]+`)
index cf2b021dfc9afe0182f0e8d71d402a8016301585..1db8ee69727ac9d24042989641268b76bc7dbf92 100644 (file)
@@ -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,
index e3abb480a2f959196334154e01ce21682886fbd3..cd2eef99bcd47ea02f50195c65850b948a819890 100644 (file)
@@ -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;
index 40246b9ecaffd912ce8a2f560cb1ff854657b005..99de7de73e77e75aa47bf8eb140e249976d99c2b 100644 (file)
@@ -1 +1 @@
-0.5.12.0204 Beta
\ No newline at end of file
+0.5.12.0206 Beta
\ No newline at end of file