Skip to content

Commit

Permalink
Escape attributes section with two newlines
Browse files Browse the repository at this point in the history
Do not interpret attributes section of an extra file if it starts with
two blank lines (previously: one blank line).  This is a breaking
change, however not very drastical.  Seems to be a good compromise
between simplicity and ease of use.
  • Loading branch information
skalee committed Dec 11, 2019
1 parent 5896a19 commit bcfb36c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/code_objects/extra_file_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@
expect(file.contents).to eq " #!foobar\nHello"
end

it "does not parse out attributes if there are newlines prior to attributes" do
file = ExtraFileObject.new('file.txt', "\n# @title\nFOO BAR")
it "does not parse out attributes if there are at least two newlines prior to attributes" do
file = ExtraFileObject.new('file.txt', "\n\n# @title\nFOO BAR")
expect(file.attributes).to be_empty
expect(file.contents).to eq "\n# @title\nFOO BAR"
expect(file.contents).to eq "\n\n# @title\nFOO BAR"
end

it "sets contents to data after attributes" do
Expand Down

0 comments on commit bcfb36c

Please sign in to comment.