summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorBwko <bouwko@gmail.com>2016-12-31 11:06:09 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2016-12-31 18:06:09 +0800
commit9ccc3698d5d0fb7555e545bc1cd618632bd8aa53 (patch)
treea7df15bdfb9a0857861ef7b1b01b97c7bb21d7d6 /public
parent6e5fffbd3f5414ead3f617f6f07c597ee6cfdf06 (diff)
downloadgitea-9ccc3698d5d0fb7555e545bc1cd618632bd8aa53.tar.gz
gitea-9ccc3698d5d0fb7555e545bc1cd618632bd8aa53.zip
Fix wrong anchors for non-latin headings (#3981) (#512)
Change Javascript regular expression to match non-latin characters The regex comes from here: http://stackoverflow.com/questions/150033/regular-expression-to-match-non-english-characters#comment22322603_150078 And this patch should fixed these two issues: #3919 #3843
Diffstat (limited to 'public')
-rw-r--r--public/js/index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 214308ef43..590fafa8d8 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -1347,7 +1347,7 @@ $(document).ready(function () {
var headers = {};
$(this).find('h1, h2, h3, h4, h5, h6').each(function () {
var node = $(this);
- var val = encodeURIComponent(node.text().toLowerCase().replace(/[^\w\- ]/g, '').replace(/[ ]/g, '-'));
+ var val = encodeURIComponent(node.text().toLowerCase().replace(/[^\u00C0-\u1FFF\u2C00-\uD7FF\w\- ]/g, '').replace(/[ ]/g, '-'));
var name = val;
if (headers[val] > 0) {
name = val + '-' + headers[val];