Fix #4230: Inconsistency between DText preview and DText renders of inline DText.
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
class DtextPreviewsController < ApplicationController
|
class DtextPreviewsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
render :inline => "<%= format_text(params[:body]) %>"
|
@inline = params[:inline].to_s.truthy?
|
||||||
|
@disable_mentions = params[:disable_mentions].to_s.truthy?
|
||||||
|
|
||||||
|
render inline: "<%= format_text(params[:body], inline: @inline, disable_mentions: @disable_mentions) %>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,20 +21,14 @@ Dtext.initialize_expandables = function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Dtext.call_preview = function(e, $button, $input, $preview) {
|
Dtext.call_preview = async function(e, $button, $input, $preview) {
|
||||||
$button.val("Edit");
|
$button.val("Edit");
|
||||||
$input.hide();
|
$input.hide();
|
||||||
$preview.text("Loading...").fadeIn("fast");
|
$preview.text("Loading...").fadeIn("fast");
|
||||||
$.ajax({
|
|
||||||
type: "post",
|
let inline = $input.is("input");
|
||||||
url: "/dtext_preview",
|
let html = await $.post("/dtext_preview", { body: $input.val(), inline: inline });
|
||||||
data: {
|
$preview.html(html).fadeIn("fast");
|
||||||
body: $input.val()
|
|
||||||
},
|
|
||||||
success: function(data) {
|
|
||||||
$preview.html(data).fadeIn("fast");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Dtext.call_edit = function(e, $button, $input, $preview) {
|
Dtext.call_edit = function(e, $button, $input, $preview) {
|
||||||
|
|||||||
@@ -20,9 +20,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><%= PostPresenter.preview(post_appeal.post, :tags => "status:any") %></td>
|
<td><%= PostPresenter.preview(post_appeal.post, :tags => "status:any") %></td>
|
||||||
<td>
|
<td>
|
||||||
<div class="prose">
|
<span class="prose">
|
||||||
<%= format_text post_appeal.reason %>
|
<%= format_text post_appeal.reason, inline: true %>
|
||||||
</div>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to post_appeal.post.appeals.size, post_appeals_path(search: { post_id: post_appeal.post_id }) %>
|
<%= link_to post_appeal.post.appeals.size, post_appeals_path(search: { post_id: post_appeal.post_id }) %>
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
<tr class="resolved-<%= post_flag.is_resolved? %>">
|
<tr class="resolved-<%= post_flag.is_resolved? %>">
|
||||||
<td><%= PostPresenter.preview(post_flag.post, :tags => "status:any") %></td>
|
<td><%= PostPresenter.preview(post_flag.post, :tags => "status:any") %></td>
|
||||||
<td>
|
<td>
|
||||||
<div class="prose">
|
<span class="prose">
|
||||||
<%= format_text post_flag.reason %>
|
<%= format_text post_flag.reason, inline: true %>
|
||||||
</div>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to post_flag.post.flags.size, post_flags_path(search: { post_id: post_flag.post_id }) %>
|
<%= link_to post_flag.post.flags.size, post_flags_path(search: { post_id: post_flag.post_id }) %>
|
||||||
|
|||||||
Reference in New Issue
Block a user