Shlomi Fish avatar Shlomi Fish committed e51beba

Add the item about non-valid markup.

Comments (0)

Files changed (2)

 CURRENT TASKS:
     - Bad elements page:
         - Packaging as a CPAN distribution.
-        - Generating Invalid markup (HTML, etc.)
         - Unrelated packages (e.g: OtherModule) inside MyModule.
             - Preferably every package should be inside one module (except for
             private ones).
         @ DONE [Fri 2013-05-03]
     - Bad elems: Generally - don't use punctuation variables.
         @ DONE [Fri 2013-05-03]
+    - Bad elems: Generating Invalid markup (HTML, etc.)
+        @ DONE [Sat 2013-05-04]
 
 # vim:ft=quicktask:sw=4:ts=4:et

src/tutorials/bad-elements/perl-elements-to-avoid.xml-grammar-vered.xml

 alternatives.
 </p>
 </item>
+<item xml:id="generating_non_valid_markup">
+<info>
+<title>Generating non-validing Markup (of HTML/etc.)</title>
+</info>
+<p>
+You should make sure that the HTML markup you generate is
+<a xlink:href="http://en.wikipedia.org/wiki/XHTML#Valid_XHTML_documents">valid
+HTML</a> and that it validates as XHTML 1.0, HTML 4.01, HTML 5.0, or a
+different modern standard. For more information, see
+<a xlink:href="http://www.shlomifish.org/lecture/LAMP/slides/compatibility/">the
+“Designing for Compatibility” section</a> in a previous talk.
+</p>
+<p>
+Some bad code is:
+</p>
+<bad_code syntax="perl">
+print &lt;&lt;'EOF';
+&lt;P&gt;
+&lt;FONT COLOR="red"&gt;Hello.
+&lt;P&gt;
+&lt;FONT COLOR="green"&gt;Mr. Smith
+EOF
+</bad_code>
+<p>
+A better code would be:
+</p>
+<code_blk syntax="perl">
+print &lt;&lt;'EOF';
+&lt;p class="greeting"&gt;
+Hello
+&lt;/p&gt;
+&lt;p class="name"&gt;
+My. Smith
+&lt;/p&gt;
+EOF
+</code_blk>
+</item>
 </section>
 <section xml:id="sources_of_advice">
 <info>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.