"}, transformed)
end
- def test_does_not_wrap_markdown_and_wordml_with_nil_value
- transformed = Sablon::Context.transform({"markdown:mykey" => nil, "word_ml:otherkey" => nil, "normalkey" => nil})
+ def test_does_not_wrap_html_and_wordml_with_nil_value
+ transformed = Sablon::Context.transform({"html:mykey" => nil, "word_ml:otherkey" => nil, "normalkey" => nil})
assert_equal({ "mykey" => nil,
"otherkey" => nil,
"normalkey" => nil}, transformed)
diff --git a/test/fixtures/recipe_context.json b/test/fixtures/recipe_context.json
index fabec54b..b8319578 100644
--- a/test/fixtures/recipe_context.json
+++ b/test/fixtures/recipe_context.json
@@ -13,7 +13,7 @@
},
"title": "Bruschetta",
"word_ml:intro": "Bruschetta (Italian pronunciation: [bruˈsketta]) is an antipasto (starter dish) from Italy consisting of grilled bread rubbed with garlic and topped with tomatoes, olive oil, salt and pepper. Variations may include toppings of tomato, vegetables, beans, cured meat, or cheese, a popular dish is Bruschetta pomodoro; the most popular recipe outside of Italy involves basil, fresh tomato, garlic and onion or mozzarella. Bruschetta is usually served as a snack or appetizer. In some countries, a topping of chopped tomato, olive oil and herbs is marketed under the bruschetta name.",
- "markdown:preparation": "## How to make Baby's Bruschetta\n\n### Preparation\nMake the bruschetta mixture one day before the event and let it sit in the fridge overnight to absorb all the flavours(be aware your fridge will smell entirely like the *tomatoes* and *garlic*\n\nI find it works best to slice the *baguette* on an angle to create more space. Put the broiler on the oven on to toast the bread. Line them up on a baking sheet and make a small mixture of chopped garlic and olive oil to lightly spread on the slices of *baguette*, then place into the oven.\n\nOnce Half toasted remove bread and place bruschetta mixture on top (after draining off the majority of fluid). Then sprinkle the grated cheese on top and place back into the oven to broil/toast to your desired effect. ~ Please note that if you prefer to not have your *cheese* melted you can skip this step and just toast the bread fully, add the mixture and *cheese* and serve.\n\nOnce melted, remove and place directly on a serving platter and let rest for one minute while adding fresh chopped *basil* for garnish, and **ENJOY!**\n\n### Variations\n\n1. Use fresh oregano instead of basil.\n1. Other possible toppings: prosciutto, salami, bean spreads\n\n### Notes\n- In **Italy**, bruschetta is often prepared using a brustolina grill. In the Abruzzo region of Italy a variation of bruschetta made with a salame called *ventricina* is served.\n- In **Tuscany** it is called *fettunta* and it is usually served without toppings, \nespecially in November, to taste the very first oil of the season.\n- The chinese translation of 'Bruschetta' is '大蒜麵包' (Google Translator)",
+ "html:preparation": "How to make Baby's Bruschetta
\nPreparation
Make the bruschetta mixture one day before the event and let it sit in the fridge overnight to absorb all the flavours(be aware your fridge will smell entirely like the tomatoes and garlic
I find it works best to slice the baguette on an angle to create more space. Put the broiler on the oven on to toast the bread. Line them up on a baking sheet and make a small mixture of chopped garlic and olive oil to lightly spread on the slices of baguette, then place into the oven.
Once Half toasted remove bread and place bruschetta mixture on top (after draining off the majority of fluid). Then sprinkle the grated cheese on top and place back into the oven to broil/toast to your desired effect. ~ Please note that if you prefer to not have your cheese melted you can skip this step and just toast the bread fully, add the mixture and cheese and serve.
Once melted, remove and place directly on a serving platter and let rest for one minute while adding fresh chopped *basil* for garnish, and ENJOY!
Variations
- Use fresh oregano instead of basil.
- Other possible toppings: prosciutto, salami, bean spreads
Notes
- In Italy, bruschetta is often prepared using a brustolina grill. In the Abruzzo region of Italy a variation of bruschetta made with a salame called ventricina is served.
- In Tuscany it is called fettunta and it is usually served without toppings, especially in November, to taste the very first oil of the season.
- The chinese translation of 'Bruschetta' is '大蒜麵包' (Google Translator)
",
"ingredients": [
{"name": "Ripened, chopped, medium sized tomatoes ", "amount": "6"},
{"name": "medium sized red (Spanish) onion", "amount": "1"},
diff --git a/test/fixtures/recipe_sample.docx b/test/fixtures/recipe_sample.docx
index 7d642a81..fb2b41db 100644
Binary files a/test/fixtures/recipe_sample.docx and b/test/fixtures/recipe_sample.docx differ
diff --git a/test/markdown_test.rb b/test/markdown_test.rb
deleted file mode 100644
index 6dc7377b..00000000
--- a/test/markdown_test.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-# -*- coding: utf-8 -*-
-require "test_helper"
-require "support/xml_snippets"
-
-class SablonMarkdownTest < Sablon::TestCase
- include Sablon::Test::Assertions
-
- def setup
- super
- @base_path = Pathname.new(File.expand_path("../", __FILE__))
-
- @sample_path = @base_path + "fixtures/markdown_sample.docx"
- end
-
- def test_generate_document_from_template_with_styles_and_markdown
- template_path = @base_path + "fixtures/insertion_template.docx"
- output_path = @base_path + "sandbox/markdown.docx"
- template = Sablon.template template_path
- context = {'markdown:content' => content}
- template.render_to_file output_path, context
-
- assert_docx_equal @sample_path, output_path
- end
-
- private
- def content
- <<-MARKDOWN
-# Sablon Markdown insertion
-
-## Text
-
-**_Lorem ipsum_ dolor sit amet, consectetur adipiscing elit. Suspendisse at libero at elit posuere convallis ac vitae augue. Morbi pretium diam et leo pulvinar, sit amet placerat mauris scelerisque.** Vivamus sollicitudin ante ligula, non egestas diam molestie at.
-
-Nunc tincidunt massa id libero mollis bibendum.
-Sed vel arcu blandit, scelerisque ex ut, semper justo.
-Nunc tempor velit a tortor lacinia, vel mattis diam sollicitudin.
-Etiam eget faucibus enim.
-
-Curabitur rutrum vestibulum nisi, vel posuere ligula commodo a. Sed nibh odio, convallis vitae orci a, cursus venenatis tellus. Duis consequat auctor elementum. Quisque blandit augue id faucibus dignissim. Aenean malesuada placerat turpis. Mauris tincidunt lorem sit amet est ultricies, eu tristique arcu dapibus. Nam ultrices vulputate tellus, quis feugiat ante faucibus non. Donec lectus est, suscipit in arcu molestie, pharetra cursus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
-
-## Lists
-
-* Etiam vulputate elementum mi, at porta est malesuada sit amet.
-* Praesent porttitor arcu id justo dignissim, vitae dignissim lectus pharetra.
-* Curabitur efficitur mauris ac justo porta dignissim. Integer sed dui justo.
-
-Donec finibus lectus a erat pharetra dapibus.
-
-1. Nulla facilisis aliquet ex.
-1. Mauris eget ante sed purus dictum tempus eu non dolor.
-1. Aliquam finibus, leo at rutrum euismod, urna quam scelerisque ante, eu finibus dolor lectus vel ipsum.
-
-Ut id condimentum ante, eget convallis justo. Quisque accumsan porta interdum. Integer sit amet luctus felis.
-
-Nunc imperdiet, massa id ultricies porttitor, felis magna tincidunt augue, a egestas orci neque sed odio.
-
-1. Suspendisse
- 1. tempor
- 1. turpis
- 1. turpis
- 1. vitae
- 1. tristique
- 1. nulla
- 1. pulvinar
-1. nec.
-
-* Suspendisse
- * potenti
- * In condimentum
- * enim ut nibh cursus imperdiet.
- * Aliquam
- * lacinia
- * scelerisque
-* tristique.
-
-Phasellus consectetur placerat ornare. Nulla facilisi. Morbi fringilla est vitae pulvinar dictum. Praesent quis malesuada ex. Pellentesque posuere facilisis molestie.
-
-Maecenas pretium erat vitae neque convallis consectetur. Cras ultricies mi nec mauris consectetur, eu blandit purus mattis. Quisque ante nulla, sagittis sed interdum non, eleifend quis augue. Curabitur vestibulum quam sed blandit rhoncus. Morbi eget vestibulum felis. Nulla vitae molestie elit. Etiam sagittis lorem elit, sit amet rhoncus eros dapibus non. Praesent nec dignissim dui. Quisque quis vehicula turpis, sit amet aliquet leo. Ut urna magna, malesuada eget fringilla ut, laoreet sed diam. Maecenas a ipsum varius, efficitur eros quis, vulputate mauris.
-MARKDOWN
- end
-end
diff --git a/test/sablon_test.rb b/test/sablon_test.rb
index 8f04a406..c38f2d19 100644
--- a/test/sablon_test.rb
+++ b/test/sablon_test.rb
@@ -65,7 +65,7 @@ def test_generate_document_from_template
language.new("German", "fluent"),
language.new("French", "basics"),
],
- about_me: Sablon.content(:markdown, "I am fond of writing *short stories* and *poems* in my spare time, \nand have won several literary contests in pursuit of my **passion**."),
+ about_me: Sablon.content(:html, "I am fond of writing short stories and poems in my spare time,
and have won several literary contests in pursuit of my passion."),
activities: ["Writing", "Photography", "Traveling"],
referees: [
referee.new("Mary P. Larsen", "Strongbod",