From: Tom Hughes Date: Sun, 2 Dec 2012 17:00:33 +0000 (+0000) Subject: Return note comments as formatted HTML as well as text X-Git-Tag: live~5068^2~56 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/2ddd667910301e73a9961ffd70b72011f1dfb22a Return note comments as formatted HTML as well as text --- diff --git a/app/views/notes/_note.json.jsonify b/app/views/notes/_note.json.jsonify index 5724dfd54..c702d9254 100644 --- a/app/views/notes/_note.json.jsonify +++ b/app/views/notes/_note.json.jsonify @@ -24,6 +24,10 @@ json.properties do end json.action comment.event - json.text comment.body unless comment.body.nil? + + if comment.body + json.text comment.body.to_text + json.html comment.body.to_html + end end end diff --git a/app/views/notes/_note.xml.builder b/app/views/notes/_note.xml.builder index 7e4585f86..259f70405 100644 --- a/app/views/notes/_note.xml.builder +++ b/app/views/notes/_note.xml.builder @@ -21,7 +21,10 @@ xml.note("lon" => note.lon, "lat" => note.lat) do xml.user_url user_url(:display_name => comment.author.display_name) end - xml.text comment.body + if comment.body + xml.text comment.body.to_text + xml.html comment.body.to_html + end end end end