Skip to content

Commit

Permalink
Escape double quotes from the actions and notes.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.textmate.org/trunk/Bundles/GTDAlt.tmbundle@5676 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information
Charilaos Skiadas committed Oct 28, 2006
1 parent 91a2997 commit b40fae4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Support/bin/get_lists.rb
Expand Up @@ -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}\""
Expand Down

0 comments on commit b40fae4

Please sign in to comment.