0

我正在使用 ercury-rails gem,你可以在这里找到它。一切正常,除了参数 [:value]。我不断在我的文本末尾收到“br 标签”,我想更新它。所以我的参数看起来像这样

Parameters: {"content"=>{"post_title"=>{"type"=>"full", "value"=>"yeah<br>"}

任何人都可能有一个想法,为什么会发生这种情况?顺便说一句,这是我的代码:

<script>
    $(window).on('mercury:ready', function () {
        var link = $('#mercury_iframe').contents().find('#edit_link');
        Mercury.saveUrl = "<%= mercury_update_admin_post_path(@post) %>";
        link.hide();
    });


</script>
<div id="container">
    <div><p id="notice"><%= notice %></p></div>

    <div>
        <h2><span id="post_title" class="mercury-region" data-type="editable" data-mercury="full"><%= @post.title %></span></h2>
    </div>

    <div>
        <p>
            <%= @post.date.strftime("%B %d, %Y")%>
        </p>
    </div>

    <div class="post-body">
        <div id="post_body" class="mercury-region" data-type="editable" data-mercury="full">
            <%= raw simple_format(@post.body) %>
        </div>
    </div>

    <div>
        <%= link_to 'Edit', "/editor" + request.path, :class => "btn", :id => "edit_link" %>
        <%= link_to 'Back', admin_posts_path, :class => "btn" %>
    </div>
</div>

谢谢。如果有人可以提供帮助,我会非常高兴。

4

1 回答 1

1

您好,这里是一些从您的内容中删除 br 标记的文档,请仔细阅读。我希望如果您浏览此网址,您可能会得到一些解决方案。

BR 标签问题

在上面的网址中,您将有一些选项可以在最后禁用 br 标记。

pageEditor = new Mercury.FormPageEditor('form.mercury-form', options);
pageEditor.document.execCommand('insertBrOnReturn', false, false);

我希望这有帮助。

于 2013-08-01T12:37:44.567 回答