Wed 15 Feb 2006 06:06:49 PM UTC, comment #5:
> The only requirement for this function is that it can start with any tag.
> There must not be any previously opened tag (like <p>).
Hum, on the contrary to fit well, it should actually works by assuming that <p> is opened and will be closed </p> afterwards.
Ok, we could say it would be cleaner that utils_wiki_markup() open and close it itself but: But in some cases we may not want that.
- What we are sure is that we almost always want
tils_wiki_markup() to run in a <p> block, but we are not sure that we always want to start that block the moment where we start utils_wiki_markup().
- In some cases, we may want to use utils_wiki_markup() in context where it is actually not in a <p> block. It is the cases like CC comment, or attached file comment. And in this cases, no complex formatting is allowed anyway: only links and bold, italic.
So actually, it will be just easier for us if utils_wiki_markup() give us the latitude of decide if we want to be in <p> context, but it should be in comment that if we decide to use utils_wiki_markup somewhere and to allow high level formatting (list, headers, hr), then we have to make sure by ourselves that we are in an opened <p> block.
|
Wed 15 Feb 2006 05:41:52 PM UTC, comment #4:
Well, utils_wiki_markup() currently does exactly the Right Thing(tm), all output is valid XHTML. It does take care of a paragraph followed by a heading and uses </p> before writing <h3>.
Moreover, every paragraph is marked with <p>, so your CSS formatting change will work seamlessly.
The only requirement for this function is that it can start with any tag. There must not be any previously opened tag (like <p>).
|
Wed 15 Feb 2006 05:31:57 PM UTC, comment #3:
Arg, that's very annoying, because <p> is used nicely all around for each text that is paragraph like.
And using <div> or <span> instead would be dumb, because it really <p> that is meaningful in this context. Not to mention that in some cases like <p class="smaller">, we would have to add even more <span>.
Couldn't simply add
</p>
<p>
around each element that are not allowed into <p>.
For instance
= adad =
would result in
</p><h1>adad</h1><p>
It is not ubercool but it would do the job safely.
And having things like
<p>
</p><h1>adad</h1><p>
</p>
should not be a problem, as most browsers ignores <p></p>
Frankly, I've checked for this "justify" issue thing, and <p> is everywhere we want a real justified paragraph. It clearly for the best :] to go this way.
Note however that due to fit in properly <ul> and similar tags added by wiki markup should have the same CSS attributes than <p> (some padding) to fit in properly.
|
Wed 15 Feb 2006 05:04:10 PM UTC, comment #2:
> IMHO, utils_wiki_markup should be of safe usage: it should
> always provide XHTML compliant code.
Yes, I've put quite some effort into that function to gracefully handle user errors and still produce valid XHTML.
> We must be able to write
> print '<p>'.utils_wiki_markup($content).'</p>';
> safely.
Hm, that won't be possible. We must rely on utils_wiki_markup to always return valid XHTML markup. If in doubt, we should change the calling code.
The reason is simply that you don't know in advance how the $content will be rendered. If it starts with a heading, you won't get valid XHTML with your code example above, because you'll get this: "<p><h1>heading</h1></p>".
This is even true if you disallow all headings, <hr>, and lists for $content, because $content might start with a quoted paragraph, which would result in '<p><p class="quote">> Quote</p></p>'.
|
Wed 15 Feb 2006 02:43:50 PM UTC, comment #1:
This actually also means that we should not provide any means to add a <p>, that would break things.
In verbatim case, when should then add a <div>
(I know that I previously more or less said the contrary, but I was mistaken, it is important that no <p> is added inside text fields)
|
Wed 15 Feb 2006 02:21:05 PM UTC, original submission:
For some reasons, there are extra <p> added in comments
When then end up with things like
<a name="comment2" href="#comment2" class="preinput">mercredi 15.02.2006 at 14:14, comment #2:</a><p><p><br />
</p><p class="quote">> adad da<br />
<br />
> aaadad<br />
<br />
</p>
<p><br />
ada
</p></p>
Several <p><p>, </p></p>, all this being not valid XHTML.
I think utils_wiki_markup should add any <p>, this will cause too much headaches.
IMHO, utils_wiki_markup should be of safe usage: it should always provide XHTML compliant code. And as such, it should not assume that it can or cannot put <p> somewhere.
We must be able to write
print '<p>'.utils_wiki_markup($content).'</p>';
safely.
Moreover, I think all comments and original submission should be in "text-align: justify" and verbatim would just force an "text-align: left" (I'll post another item for that).
|