Permalink
Browse files

Production bug fix 1.1.9

  • Loading branch information...
1 parent 965dfbd commit 7c84d41eb264d6e904cab3dff0e47a8b5e4966e0 Gordon Guthrie committed Mar 13, 2010
Showing with 36 additions and 105 deletions.
  1. +5 −0 README
  2. +5 −0 README.html
  3. +4 −2 src/markdown.erl
  4. +6 −5 src/markdown_tests.hrl
  5. +16 −98 tests/generate_tests.js
View
5 README
@@ -19,6 +19,11 @@ The code that generates tests from them in in the escript file:
Release Notes
=============
+Version 1.1.9 Production Bug Fix
+--------------------------------
+
+Wasn't handling special white space inserted by the ***PARSER*** (don't ask!)
+
Version 1.1.8 Production Bug Fix
--------------------------------
View
@@ -18,6 +18,11 @@
<h1>Release Notes</h1>
+<h2>Version 1.1.9 Production Bug Fix</h2>
+
+
+<p>Wasn't handling special white space inserted by the <strong><em>PARSER</em></strong> (don't ask!)</p>
+
<h2>Version 1.1.8 Production Bug Fix</h2>
View
@@ -56,6 +56,7 @@ conv(String) -> Lex = lex(String),
conv_utf8(Utf8) ->
Str = xmerl_ucs:from_utf8(Utf8),
Res = conv(Str),
+ io:format("Res is ~p~n", [Res]),
xmerl_ucs:to_utf8(Res).
conv_file(FileIn, FileOut) ->
@@ -1030,8 +1031,9 @@ get_email_addie(String) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
make_plain_str(List) -> m_plain(List, []).
-m_plain([], Acc) -> flatten(reverse(Acc));
-m_plain([{_, Str} | T], Acc) -> m_plain(T, [Str | Acc]).
+m_plain([], Acc) -> flatten(reverse(Acc));
+m_plain([{{ws, none}, none} | T], Acc) -> m_plain(T, [" " | Acc]);
+m_plain([{_, Str} | T], Acc) -> m_plain(T, [Str | Acc]).
make_esc_str(List, Refs) -> m_esc(List, Refs, []).
View
@@ -1,10 +1,11 @@
%% Do not edit this file - it is generated with ../tests/index.html
unit_test_() ->
[
- ?_assertEqual("<form action=\"https://checkout.google.com/api/checkout/v2/\ncheckoutForm/Merchant/960226209420618\" id=\"BB_BuyButtonForm\"\nmethod=\"post\" name=\"BB_BuyButtonForm\" target=\"_top\">\n<input name=\"item_name_1\" type=\"hidden\" value=\"Premium\nHypernumbers Account\"/><input name=\"item_description_1\" \ntype=\"hidden\" value=\"Premium Hypernumbers Account\"/>\n<input name=\"item_quantity_1\" type=\"hidden\" value=\"1\"/>\n<input name=\"item_price_1\" type=\"hidden\" value=\"90.0\"/>\n<input name=\"item_currency_1\" type=\"hidden\" value=\"GBP\"/>\n<input name=\"_charset_\" type=\"hidden\" value=\"utf-8\"/>\n<input alt=\"\" src=\"https://checkout.google.com/buttons/buy.gif?\nmerchant_id=960226209420618&amp;w=117&amp;h=48&amp;style=white&amp;\nvariant=text&amp;loc=en_US\" type=\"image\"/>\n</form>", conv("<form action=\"https://checkout.google.com/api/checkout/v2/\ncheckoutForm/Merchant/960226209420618\" id=\"BB_BuyButtonForm\"\nmethod=\"post\" name=\"BB_BuyButtonForm\" target=\"_top\">\n<input name=\"item_name_1\" type=\"hidden\" value=\"Premium\nHypernumbers Account\"/><input name=\"item_description_1\" \ntype=\"hidden\" value=\"Premium Hypernumbers Account\"/>\n<input name=\"item_quantity_1\" type=\"hidden\" value=\"1\"/>\n<input name=\"item_price_1\" type=\"hidden\" value=\"90.0\"/>\n<input name=\"item_currency_1\" type=\"hidden\" value=\"GBP\"/>\n<input name=\"_charset_\" type=\"hidden\" value=\"utf-8\"/>\n<input alt=\"\" src=\"https://checkout.google.com/buttons/buy.gif?\nmerchant_id=960226209420618&amp;w=117&amp;h=48&amp;style=white&amp;\nvariant=text&amp;loc=en_US\" type=\"image\"/>\n</form>\n")),
- ?_assertEqual("<h3>\nLets let html through\n</h3>", conv("<h3>\nLets let html through\n</h3>")),
+ ?_assertEqual("<table>\n<tr>\n<td>\n***FAQ*** - *WTF?* Postal Chess Records is a mash-up between Postal Chess and Chess Records where two Record Selectors slug it out over the interwebs in a sonic-soundclash, duh!\n</td>\n<td>\n![Logo][1]\n</td>\n</tr>\n</table>", conv("<table>\n<tr>\n<td>\n***FAQ*** - *WTF?* Postal Chess Records is a mash-up between Postal Chess and Chess Records where two Record Selectors slug it out over the interwebs in a sonic-soundclash, duh!\n</td>\n<td>\n![Logo][1]\n</td>\n</tr>\n</table>\n [1]: http://imgur.com/VmdEL.png")),
+ ?_assertEqual("<form action=\"https://checkout.google.com/api/checkout/v2/\ncheckoutForm/Merchant/960226209420618\" id=\"BB_BuyButtonForm\"\nmethod=\"post\" name=\"BB_BuyButtonForm\" target=\"_top\">\n<input name=\"item_name_1\" type=\"hidden\" value=\"Premium\nHypernumbers Account\"/><input name=\"item_description_1\" \ntype=\"hidden\" value=\"Premium Hypernumbers Account\"/>\n<input name=\"item_quantity_1\" type=\"hidden\" value=\"1\"/>\n<input name=\"item_price_1\" type=\"hidden\" value=\"90.0\"/>\n<input name=\"item_currency_1\" type=\"hidden\" value=\"GBP\"/>\n<input name=\"_charset_\" type=\"hidden\" value=\"utf-8\"/>\n<input alt=\"\" src=\"https://checkout.google.com/buttons/buy.gif?\nmerchant_id=960226209420618&amp;w=117&amp;h=48&amp;style=white&amp;\nvariant=text&amp;loc=en_US\" type=\"image\"/></form>", conv("<form action=\"https://checkout.google.com/api/checkout/v2/\ncheckoutForm/Merchant/960226209420618\" id=\"BB_BuyButtonForm\"\nmethod=\"post\" name=\"BB_BuyButtonForm\" target=\"_top\">\n<input name=\"item_name_1\" type=\"hidden\" value=\"Premium\nHypernumbers Account\"/><input name=\"item_description_1\" \ntype=\"hidden\" value=\"Premium Hypernumbers Account\"/>\n<input name=\"item_quantity_1\" type=\"hidden\" value=\"1\"/>\n<input name=\"item_price_1\" type=\"hidden\" value=\"90.0\"/>\n<input name=\"item_currency_1\" type=\"hidden\" value=\"GBP\"/>\n<input name=\"_charset_\" type=\"hidden\" value=\"utf-8\"/>\n<input alt=\"\" src=\"https://checkout.google.com/buttons/buy.gif?\nmerchant_id=960226209420618&amp;w=117&amp;h=48&amp;style=white&amp;\nvariant=text&amp;loc=en_US\" type=\"image\"/></form>\n")),
+ ?_assertEqual("<h3>Lets let html through</h3>", conv("<h3>Lets let html through</h3>")),
?_assertEqual("<p>&copy;</p>", conv("&copy;")),
- ?_assertEqual("<h3 id='test'>\nLets let html through\n</h3>", conv("<h3 id='test'>\nLets let html through\n</h3>")),
+ ?_assertEqual("<h3 id='test'>Lets let html through</h3>", conv("<h3 id='test'>Lets let html through</h3>")),
?_assertEqual("<p><img src=\"_underscore\" alt=\"login\" title=\"\" /></p>", conv("![login](_underscore)")),
?_assertEqual("<p><a href=\"_underscore\">login</a></p>", conv("[login](_underscore)")),
?_assertEqual("<ol>\n<li>should be <em>italic</em></li>\n<li>should be <strong>bold</strong></li>\n<li>should be <strong><em>bold italic</em></strong></li>\n</ol>", conv("\n 1. should be *italic*\n 2. should be **bold**\n 3. should be ***bold italic***")),
@@ -126,8 +127,8 @@ unit_test_() ->
?_assertEqual("<h1>blahblah</h1>\n\n<p>blah</p>", conv("blahblah\n====\nblah")),
?_assertEqual("<h2>blahblah</h2>", conv("blahblah\n-----")),
?_assertEqual("<h1>blahblah</h1>", conv("blahblah\n====")),
- % ?_assertEqual("<p>blah\nblah</p>", conv("blah\r\nblah\n")),
- % ?_assertEqual("<p>blah\nblah</p>", conv("blah\r\nblah")),
+ ?_assertEqual("<p>blah\nblah</p>", conv("blah\r\nblah\n")),
+ ?_assertEqual("<p>blah\nblah</p>", conv("blah\r\nblah")),
?_assertEqual("<p>blah\nblah</p>", conv("blah\nblah")),
?_assertEqual("<p><strong><em>you</em></strong> sad bastard\na</p>", conv("___you___ sad bastard\na")),
?_assertEqual("<p><strong>you</strong> sad bastard\na</p>", conv("__you__ sad bastard\na")),
Oops, something went wrong.

0 comments on commit 7c84d41

Please sign in to comment.