2
0
mirror of https://github.com/moebooru/moebooru synced 2025-08-30 13:37:48 +00:00

Capture the original case from shortlinks

This commit is contained in:
Nurahmadie
2012-05-18 23:06:41 +07:00
parent 3c485e02c2
commit b8efab6e15
2 changed files with 5 additions and 5 deletions

View File

@@ -36,10 +36,10 @@ module DText
end end
str.gsub! /\[b\](.+)\[\/b\]/, '<strong>\1</strong>' str.gsub! /\[b\](.+)\[\/b\]/, '<strong>\1</strong>'
str.gsub! /\[i\](.+)\[\/i\]/, '<em>\1</em>' str.gsub! /\[i\](.+)\[\/i\]/, '<em>\1</em>'
str.gsub! /post #(\d+)/i, '<a href="/post/show/\1">post #\1</a>' str.gsub! /(post #(\d+))/i, '<a href="/post/show/\2">\1</a>'
str.gsub! /forum #(\d+)/i, '<a href="/forum/show/\1">forum #\1</a>' str.gsub! /(forum #(\d+))/i, '<a href="/forum/show/\2">\1</a>'
str.gsub! /comment #(\d+)/i, '<a href="/comment/show/\1">comment #\1</a>' str.gsub! /(comment #(\d+))/i, '<a href="/comment/show/\2">\1</a>'
str.gsub! /pool #(\d+)/i, '<a href="/pool/show/\1">pool #\1</a>' str.gsub! /(pool #(\d+))/i, '<a href="/pool/show/\2">\1</a>'
str.gsub! /\[spoilers?\]/, '<span href="#" class="spoiler" onclick="Comment.spoiler(this); return false;"><span class="spoilerwarning">spoiler</span></span><span class="spoilertext" style="display: none">' str.gsub! /\[spoilers?\]/, '<span href="#" class="spoiler" onclick="Comment.spoiler(this); return false;"><span class="spoilerwarning">spoiler</span></span><span class="spoilertext" style="display: none">'
str.gsub! /\[spoilers?=(.+?)\]/, '<span href="#" class="spoiler" onclick="Comment.spoiler(this); return false;"><span class="spoilerwarning">\1</span></span><span class="spoilertext" style="display: none">' str.gsub! /\[spoilers?=(.+?)\]/, '<span href="#" class="spoiler" onclick="Comment.spoiler(this); return false;"><span class="spoilerwarning">\1</span></span><span class="spoilertext" style="display: none">'
str.gsub! /\[\/spoilers?\]/, '</span>' str.gsub! /\[\/spoilers?\]/, '</span>'

View File

@@ -1,4 +1,4 @@
link to wiki <a href="/wiki/show?title=5_nen_me_no_houkago">5 nen me no houkago</a> link to wiki <a href="/wiki/show?title=5_nen_me_no_houkago">5 nen me no houkago</a>
<br>another link <a href="/wiki/show?title=5_nen_me_no_houkago">kantoku</a> <br>another link <a href="/wiki/show?title=5_nen_me_no_houkago">kantoku</a>
<br>search tag <a href="/post/index?tags=kantoku+yuuhi">kantoku yuuhi</a> <br>search tag <a href="/post/index?tags=kantoku+yuuhi">kantoku yuuhi</a>
<br><a href="/post/show/2">post #2</a> <a href="/pool/show/3">pool #3</a>, (<a href="/comment/show/2">comment #2</a>): <a href="/forum/show/15">forum #15</a>. <br><a href="/post/show/2">Post #2</a> <a href="/pool/show/3">Pool #3</a>, (<a href="/comment/show/2">comment #2</a>): <a href="/forum/show/15">forum #15</a>.