Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Escape double quotes when making YAML frontmatter. Fixes #12
Browse files Browse the repository at this point in the history
  • Loading branch information
Casey Kuhlman committed Jul 17, 2013
1 parent 00304ea commit 30c7501
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/legal_markdown/make_yaml_frontmatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def filter_yaml(stuff)

def sink_it(section)
section.inject("") do |string, head|
string << head[0] + ": \"" + ( head[1].to_s || "" ) + "\"\n"
string << head[0] + ": \"" + ( head[1].to_s.gsub("\"", "\\\"") || "" ) + "\"\n"
string
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/tests/45.all_features_speed_ratchet.headers
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ party1_address: "234567890pokjhgfds"
party1_full: "asdfghjkl"
party1_reg: ""
party1_rep: ""
party1_short: "("qwertyuikjnbvcx")"
party1_short: "(\"qwertyuikjnbvcx\")"
party1_type: ""
party2: "poiuytrew"
party2_address: "234567i8o9poikuyhgrfeds"
party2_full: "wertyuilkjhgfdsa"
party2_reg: "the State of Tennessee"
party2_rep: "wertyuiop"
party2_short: "("sdfghjkl;.kjnbvcdsx")"
party2_short: "(\"sdfghjkl;.kjnbvcdsx\")"
party2_type: "Limited Liability Corporation"
party3: ""
party3_address: ""
Expand Down

0 comments on commit 30c7501

Please sign in to comment.