Created
March 17, 2016 13:09
-
-
Save vividtone/4795436465a29540149d to your computer and use it in GitHub Desktop.
Redmineで file:// で始まるURLがリンクとして表示されるようにする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* RedmineのチケットやWikiで file:// で始まるURLをリンクとして | |
* 表示する。 | |
* | |
* 【使い方】 | |
* 使用しているテーマの javascripts/theme.js にこのコードを追記する。 | |
* | |
* 【備考】 | |
* Redmineで file:// がリンクにならないのは仕様。 | |
* | |
* Feature #7370: Interpret "file://" into issue description | |
* http://www.redmine.org/issues/7370 | |
* | |
*/ | |
$(function(){ | |
$('.wiki').each(function() { | |
var doc = $(this).html(); | |
$(this).html( | |
doc.replace(/(file:\/\/[^\s<]*)/g, '<a href="$1">$1</a>') | |
); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment