mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 17:33:38 +08:00
remove trailing whitespaces ❤️
This commit is contained in:
@ -6,7 +6,7 @@ module Oneboxer
|
||||
matcher /github\.com\/[^\/]+\/[^\/]+\/blob\/.*/
|
||||
favicon 'github.png'
|
||||
|
||||
def translate_url
|
||||
def translate_url
|
||||
m = @url.match(/github\.com\/(?<user>[^\/]+)\/(?<repo>[^\/]+)\/blob\/(?<sha1>[^\/]+)\/(?<file>[^#]+)(#(L(?<from>[^-]*)(-L(?<to>.*))?))?/mi)
|
||||
if m
|
||||
@from = (m[:from] || -1).to_i
|
||||
@ -19,7 +19,7 @@ module Oneboxer
|
||||
|
||||
def parse(data)
|
||||
|
||||
if @from > 0
|
||||
if @from > 0
|
||||
if @to < 0
|
||||
@from = @from - 10
|
||||
@to = @from + 20
|
||||
@ -42,7 +42,7 @@ module Oneboxer
|
||||
truncated = true
|
||||
end
|
||||
|
||||
{content: data, truncated: truncated}
|
||||
{content: data, truncated: truncated}
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user