From b40fae4c5ff54fdcc0c9dd5b4af50b9de09eba17 Mon Sep 17 00:00:00 2001 From: Charilaos Skiadas Date: Sat, 28 Oct 2006 02:12:51 +0000 Subject: [PATCH] Escape double quotes from the actions and notes. git-svn-id: http://svn.textmate.org/trunk/Bundles/GTDAlt.tmbundle@5676 dfb7d73b-c2ec-0310-8fea-fb051d288c6d --- Support/bin/get_lists.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Support/bin/get_lists.rb b/Support/bin/get_lists.rb index f4be0a5..de2884c 100755 --- a/Support/bin/get_lists.rb +++ b/Support/bin/get_lists.rb @@ -8,18 +8,21 @@ all_actions = GTD.actions contexts = GTD.get_contexts contxts = [] +def esc(str) + str.gsub('"','\\"') +end for context in contexts # puts context ar = "{context:\"#{context}\",actions:{" actions = all_actions.find_all{ |a| a.context == context} acts = [] for act in actions - it = "{action:\"#{act.name}\"" + it = "{action:\"#{esc(act.name)}\"" unless act.due.nil? then it << ",#{act.due_type || 'due'}date:\"#{act.due}\"" end unless act.note.nil? or act.note == "" then - it << ",nte:\"#{act.note}\"" + it << ",nte:\"#{esc(act.note)}\"" end it << ",completed:\"#{act.completed? ? 'yes' : 'no'}\"" it << ",link:\"#{act.txmt}\",file:\"#{act.file}\",line:\"#{act.line}\""