]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/htmlvalidation.mdwn
web commit by joey
[ikiwiki.git] / doc / todo / htmlvalidation.mdwn
1   * Doctype is XHTML 1.0 Strict
2         
3         One consideration of course is that regular users might embed html
4         that uses deprecated presentational elements like <center>. At
5         least firefox seems to handle that mixture ok. 
6         --[[Joey]]
7
8   * [ [inlinepage] ] gets wrapped in <p>...</p> which has a high chance of invalidating the page.
9
10         Since markdown does this, the only way I can think to fix it is to
11         make the inlined page text start with </p> and end with
12         <p>. Ugly, and of course there could be problems with
13         markdown enclosing it in other spanning tags in some cases.
14         I've implemented this hack now. :-/ --[[Joey]]
15
16         I used this 'hack' myself, but yesterday I came up with a better idea:  
17             <div class="inlinepage">  
18             [ [inlinepage] ]  
19             </div>  
20         This prevents markdown enclosing and even adds a useful css identifier. Problem is that this should be added to every page and not in the template(s). --[[JeroenSchot]]
21
22         I can make ikiwiki add that around every inlined page easily
23         enough. However, where is it documented? Came up dry on google.
24         --[[Joey]]
25
26         From <http://daringfireball.net/projects/markdown/syntax#html>:
27         > The only restrictions are that block-level HTML elements e.g. &lt;div&gt;, &lt;table&gt;, &lt;pre&gt;, &lt;p&gt;, etc. must be separated from surrounding content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces. Markdown is smart enough not to add extra (unwanted) &lt;p&gt; tags around HTML block-level tags. [snip]
28         > Note that Markdown formatting syntax is not processed within
29         > block-level HTML tags. E.g., you can't use Markdown-style \*emphasis\* inside an HTML block.
30
31         Because [ [inlinepage] ] isn't separated by a blank line it gets treated as a block-level element. Hmm, will this stop all formatting, including *'s to em-tags? --[[JeroenSchot]]
32
33     Ah didn't realize you meant it fixed it at the markdown level. I'll
34     think about making postprocessordirectives into
35     [[preprocessordirective]]s instead, then I could use that fix (but I'm not
36     sure how feasible it is to do that). --[[Joey]]
37
38     Done.. inlining is now a preprocessor directive, happens before
39     markdown, and the inlinepage template uses div as suggested, this does
40     prevent markdown from doing any annoying escaping of the preprocessor
41     directives, as well as preventing it wrapping subpages in &lt;p&gt;.
42     --[[Joey]]
43
44 This page is now valid.
45 Test: [validate this page](http://validator.w3.org/check?url=referer)
46
47 [[todo/done]]