bernat/best_in_place — pull request #202 by dtuite (2012-11-26 11:40:08+00:00)
Title: Don't JS escape 'display_as' responses when :sanitize => false

The jQuery.fn.text() method will automatically escape all text when
inserting. This meant that text generated by :display_as and
:display_with options was being escaped when the user edited a field
causing the user to see raw HTML content until they refreshed the page.

Example:

<%= best_in_place post, :content, type: :textarea,
ok_button: 'Save', cancel_button: 'Cancel', sanitize: false,
display_with: lambda { |v| markdown(v) } %>

Would show escaped HTML content to the user when they edit the field and save.