Skip to content

Commit 8c23d25

Browse files
committed
Add a method to escape the name in a github fashion
1 parent d825b80 commit 8c23d25

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

js/githubwiki.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ var githubwiki = (function() {
44
module.wikiurl = '';
55

66
function githubname(name) {
7-
return name.replace(/ /g, '-').replace(/\?/g, '%3F') + '.md';
7+
return name.replace(/ /g, '-').replace(/\?/g, '%3F');
88
};
99

1010
function linkRenderer(link) {
11-
gh_name = githubname(link);
11+
gh_name = githubname(link) + '.md';
1212
return '<a href="' + module.wikiurl + gh_name + '">' + link + '</a>';
1313
};
1414

1515
function linkRendererTitle(title, link) {
16-
gh_name = githubname(link);
16+
gh_name = githubname(link) + '.md';
1717
return '<a href="' + module.wikiurl + gh_name + '">' + title + '</a>';
1818
};
1919

@@ -41,5 +41,7 @@ var githubwiki = (function() {
4141
marked.setOptions(options);
4242
};
4343

44+
module.getGithubName = githubname;
45+
4446
return module;
4547
}());

0 commit comments

Comments
 (0)