From b8efab6e15e6909b009a9f8be7a33c87dc80caff Mon Sep 17 00:00:00 2001 From: Nurahmadie Date: Fri, 18 May 2012 23:06:41 +0700 Subject: [PATCH] Capture the original case from shortlinks --- lib/dtext.rb | 8 ++++---- tests/links.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/dtext.rb b/lib/dtext.rb index 33e093cf..fceb8aa4 100644 --- a/lib/dtext.rb +++ b/lib/dtext.rb @@ -36,10 +36,10 @@ module DText end str.gsub! /\[b\](.+)\[\/b\]/, '\1' str.gsub! /\[i\](.+)\[\/i\]/, '\1' - str.gsub! /post #(\d+)/i, 'post #\1' - str.gsub! /forum #(\d+)/i, 'forum #\1' - str.gsub! /comment #(\d+)/i, 'comment #\1' - str.gsub! /pool #(\d+)/i, 'pool #\1' + str.gsub! /(post #(\d+))/i, '\1' + str.gsub! /(forum #(\d+))/i, '\1' + str.gsub! /(comment #(\d+))/i, '\1' + str.gsub! /(pool #(\d+))/i, '\1' str.gsub! /\[spoilers?\]/, 'spoiler