1
0
Fork 0
mirror of https://github.com/vuejs/awesome-vue.git synced 2024-11-27 11:25:59 -05:00

Better GitHub repo regex

This commit is contained in:
An Phan 2016-06-23 14:27:57 +08:00
parent 24861974bf
commit bd6a9fde01
2 changed files with 2 additions and 3 deletions

View file

@ -3,8 +3,7 @@
<h1 class="thin">Explore</h1>
<ul>
<li v-for="tag in coolStuff">
<a :href="'#' + tag"
@click="filterByTag(tag)">{{ tag }}</a>
<a :href="'#' + tag" @click="filterByTag(tag)">{{ tag }}</a>
</li>
</ul>
</section>

View file

@ -34,7 +34,7 @@ export default {
* @return {String|null}
*/
githubBadgeUrl() {
const re = /https?:\/\/github\.com\/([A-Za-z0-9-_]*)\/([A-Za-z0-9-_]*)\/?$/i
const re = /https?:\/\/github\.com\/([A-Za-z0-9-_\.]*)\/([A-Za-z0-9-_\.]*)\/?$/i
const matches = re.exec(this.item.url)
return matches
? `https://img.shields.io/github/stars/${matches[1]}/${matches[2]}.svg?style=social&label=★`