From 2ddd667910301e73a9961ffd70b72011f1dfb22a Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 2 Dec 2012 17:00:33 +0000 Subject: [PATCH] Return note comments as formatted HTML as well as text --- app/views/notes/_note.json.jsonify | 6 +++++- app/views/notes/_note.xml.builder | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) 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 -- 2.39.5