Jump to content

CSV to HTML translation: Difference between revisions

(Removed draft status.)
Line 773:
"</TD><TD>",
csv_td_in(L,S).
 
csv_td_in([60|T], S) -->
"&lt;",
csv_td_in(T, S).
 
csv_td_in([62|T], S) -->
"&gt;",
csv_td_in(T, S).
 
csv_td_in([H|T], S) -->
Line 788 ⟶ 796:
</TR>
<TR>
<TD>Brians mother</TD><TD><&lt;angry>&gt;Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!<>&lt;/angry>&gt;</TD>
</TR>
<TR>
Line 802 ⟶ 810:
</pre>
===Extra credit solution===
{{incorrect|Prolog|No escaping of '<' in '<angry' and '</angry'.}}|
<lang Prolog>csv_html_plus :-
L =
Line 881 ⟶ 888:
"</TD><TD style='color:#000; background:#8FF; border:1px #000 solid; padding:0.6em;'>",
csv_body_td_in(L,S).
 
csv_body_td_in([60|T], S) -->
"&lt;",
csv_body_td_in(T, S).
 
csv_body_td_in([62|T], S) -->
"&gt;",
csv_body_td_in(T, S).
 
csv_body_td_in([H|T], S) -->
Line 898 ⟶ 913:
</TR>
<TR>
<TD style='color:#000; background:#8FF; border:1px #000 solid; padding:0.6em;'>Brians mother</TD><TD style='color:#000; background:#8FF; border:1px #000 solid; padding:0.6em;'><&lt;angry>&gt;Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!<>&lt;/angry>&gt;</TD>
</TR>
<TR>
Line 915 ⟶ 930:
===HTML outputs rendered in firefox browser===
[[File:Prolog_csv_to_html.png|frame||none]]
 
 
=={{header|Python}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.