Improved quotes
This commit is contained in:
@@ -6,7 +6,7 @@ class PostsController < ApplicationController
|
||||
if params[:quote]
|
||||
quote_post = Post.find(params[:quote])
|
||||
if quote_post
|
||||
@post.body = "[quote]#{quote_post.body}[/quote]"
|
||||
@post.body = "[quote=#{quote_post.user.username}]#{quote_post.body}[/quote]"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -42,4 +42,4 @@ class PostsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,6 +4,16 @@ class TopicsController < ApplicationController
|
||||
|
||||
def show
|
||||
@topic.hit! if @topic
|
||||
|
||||
@my_blockquote = {
|
||||
'Quote' => [
|
||||
/\[quote(:.*)?=(.*?)\](.*?)\[\/quote\1?\]/mi,
|
||||
'<blockquote><cite>\2</cite><span class="a">“</span>\3<span class="b">”</span></blockquote>',
|
||||
'Quote with citation',
|
||||
'[quote=mike]please quote me[/quote]',
|
||||
:quote
|
||||
],
|
||||
}
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
Reference in New Issue
Block a user