Hi all,
I have a question regarding creating lists in wikimedia. I wonder if it is possible to have multiline <pre></pre> elements inside your list, without messing up the content inside the <pre>-tag or the list's layout. I would be grateful for any pointers to more information on how to incorporate multiline <pre>-elements into wikimedia-lists
Any multiline <pre></pre> element will not be rendered very nicely, as is shown in this example:
# first item # second item #: <code><pre>one multiline comment</pre></code> # third item
will render as: 1. first item 2. second item one multiline comment 1. third item # list starts anew here.
Is there any way to contain the line-breaks in a <pre></pre> elements, without messing up the list's layout/numbering?
thanks, Bram
This is not currently possible - if you want a multi-line <pre> block, then your best bet is to use actual <OL> and <LI> elements rather than '#' notation.
-- Jim R. Wilson (jimbojw)
On Nov 11, 2007 8:04 AM, Bram Kuijper a.l.w.kuijper@rug.nl wrote:
Hi all,
I have a question regarding creating lists in wikimedia. I wonder if it is possible to have multiline <pre></pre> elements inside your list, without messing up the content inside the <pre>-tag or the list's layout. I would be grateful for any pointers to more information on how to incorporate multiline <pre>-elements into wikimedia-lists
Any multiline <pre></pre> element will not be rendered very nicely, as is shown in this example:
# first item # second item #: <code><pre>one multiline comment</pre></code> # third item
will render as:
- first item
- second item one
multiline comment
- third item # list starts anew here.
Is there any way to contain the line-breaks in a <pre></pre> elements, without messing up the list's layout/numbering?
thanks, Bram
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Actually not always, it appears there may be a "variance" in whether mediaWiki interprets the start="n" tag, if there is an interspersed <pre> element.
Consider this which renders correctly in a Wikipage as well as in a browser: <ol> <li>one </ol> <ol start="3"> <li>three </ol>
Produces:
1. one 3. three
However inserting a <pre> element ...
<ol> <li>one </ol> <pre>text</pre> <ol start="3"> <li>three </ol>
... produces the following way in a Wikipage:
1. one text 1. three
... but is correct in a browser:
1. one text 3. three
However this works in a Wikipage: <ol><li>one</li></ol> <pre>text</pre> <ol start="3"><li>three</li></ol>
Whereas this does not: <ol> <li>one</li> </ol> <pre>text</pre> <ol start="3"> <li>three</li> </ol>
Bottom line - one may get it to work but either my <ol> syntax is flawed or there is a bug in the code.
Boris
On 12-Nov-07, at 3:38 PM, Jim Wilson wrote:
This is not currently possible - if you want a multi-line <pre> block, then your best bet is to use actual <OL> and <LI> elements rather than '#' notation.
-- Jim R. Wilson (jimbojw)
On Nov 11, 2007 8:04 AM, Bram Kuijper a.l.w.kuijper@rug.nl wrote:
Hi all,
I have a question regarding creating lists in wikimedia. I wonder if it is possible to have multiline <pre></pre> elements inside your list, without messing up the content inside the <pre>-tag or the list's layout. I would be grateful for any pointers to more information on how to incorporate multiline <pre>-elements into wikimedia-lists
Any multiline <pre></pre> element will not be rendered very nicely, as is shown in this example:
# first item # second item #: <code><pre>one multiline comment</pre></code> # third item
will render as:
- first item
- second item one
multiline comment
- third item # list starts anew here.
Is there any way to contain the line-breaks in a <pre></pre> elements, without messing up the list's layout/numbering?
thanks, Bram
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
All attributes for tags are managed by the Sanitizer, and are controlled by a strict whitelist. The 'start' attribute does not appear in the whitelist for the <ol> element, so like all non-listed attributes is stripped prior to rendering.
Besides, my suggestion was to have a single <ol> which wrapped all the content, including the <pre> block.
For example:
<ol> <li>First Item</li> <li>Second Item <pre> with a multi-line pre block </pre> </li> <li>Third Item</li> </ol>
-- Jim
On Nov 12, 2007 3:04 PM, Boris Steipe boris.steipe@utoronto.ca wrote:
Actually not always, it appears there may be a "variance" in whether mediaWiki interprets the start="n" tag, if there is an interspersed
<pre> element. Consider this which renders correctly in a Wikipage as well as in a browser: <ol> <li>one </ol> <ol start="3"> <li>three </ol> Produces: 1. one 3. three However inserting a <pre> element ... <ol> <li>one </ol> <pre>text</pre>
<ol start="3"> <li>three </ol>
... produces the following way in a Wikipage:
- one
text
- three
... but is correct in a browser:
- one
text 3. three
However this works in a Wikipage:
<ol><li>one</li></ol> <pre>text</pre> <ol start="3"><li>three</li></ol>
Whereas this does not:
<ol> <li>one</li> </ol> <pre>text</pre> <ol start="3"> <li>three</li> </ol>
Bottom line - one may get it to work but either my <ol> syntax is flawed or there is a bug in the code.
Boris
On 12-Nov-07, at 3:38 PM, Jim Wilson wrote:
This is not currently possible - if you want a multi-line <pre> block, then your best bet is to use actual <OL> and <LI> elements rather than '#' notation.
-- Jim R. Wilson (jimbojw)
On Nov 11, 2007 8:04 AM, Bram Kuijper a.l.w.kuijper@rug.nl wrote:
Hi all,
I have a question regarding creating lists in wikimedia. I wonder if it is possible to have multiline <pre></pre> elements inside your list, without messing up the content inside the <pre>-tag or the list's layout. I would be grateful for any pointers to more information on how to incorporate multiline <pre>-elements into wikimedia-lists
Any multiline <pre></pre> element will not be rendered very nicely, as is shown in this example:
# first item # second item #: <code><pre>one multiline comment</pre></code> # third item
will render as:
- first item
- second item one
multiline comment
- third item # list starts anew here.
Is there any way to contain the line-breaks in a <pre></pre> elements, without messing up the list's layout/numbering?
thanks, Bram
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Yes - that solves what the OP was asking for. But I see that the sanitizer still has a bug:
If the preceding <li> is not closed, it appears to parse to the beginning of the next<li>, skipping over the </ol><ol start="3"> and passes the start attribute of the second tag through to the page- source. Therefore
<ol> <li>First Item </ol> <ol start="12345"> <li>Third Item</li> </ol>
produces 1. First Item 12345. Third Item
Whereas .. <ol> <li>First Item</li> </ol> <ol start="12345"> <li>Third Item</li> </ol>
produces 1. First Item 1. Third Item
{{Disclaimer:New_to_this}} ... should this be filed as a bug?
B.
On 12-Nov-07, at 4:13 PM, Jim Wilson wrote:
All attributes for tags are managed by the Sanitizer, and are controlled by a strict whitelist. The 'start' attribute does not appear in the whitelist for the <ol> element, so like all non-listed attributes is stripped prior to rendering.
Besides, my suggestion was to have a single <ol> which wrapped all the content, including the <pre> block.
For example:
<ol> <li>First Item</li> <li>Second Item <pre> with a multi-line pre block </pre> </li> <li>Third Item</li> </ol>
-- Jim
On Nov 12, 2007 3:04 PM, Boris Steipe boris.steipe@utoronto.ca wrote:
Actually not always, it appears there may be a "variance" in whether mediaWiki interprets the start="n" tag, if there is an interspersed
<pre> element. Consider this which renders correctly in a Wikipage as well as in a browser: <ol> <li>one </ol> <ol start="3"> <li>three </ol> Produces: 1. one 3. three However inserting a <pre> element ... <ol> <li>one </ol> <pre>text</pre>
<ol start="3"> <li>three </ol>
... produces the following way in a Wikipage:
- one
text
- three
... but is correct in a browser:
- one
text 3. three
However this works in a Wikipage:
<ol><li>one</li></ol> <pre>text</pre> <ol start="3"><li>three</li></ol>
Whereas this does not:
<ol> <li>one</li> </ol> <pre>text</pre> <ol start="3"> <li>three</li> </ol>
Bottom line - one may get it to work but either my <ol> syntax is flawed or there is a bug in the code.
Boris
On 12-Nov-07, at 3:38 PM, Jim Wilson wrote:
This is not currently possible - if you want a multi-line <pre> block, then your best bet is to use actual <OL> and <LI> elements rather than '#' notation.
-- Jim R. Wilson (jimbojw)
On Nov 11, 2007 8:04 AM, Bram Kuijper a.l.w.kuijper@rug.nl wrote:
Hi all,
I have a question regarding creating lists in wikimedia. I wonder if it is possible to have multiline <pre></pre> elements inside your list, without messing up the content inside the <pre>-tag or the list's layout. I would be grateful for any pointers to more information on how to incorporate multiline <pre>-elements into wikimedia-lists
Any multiline <pre></pre> element will not be rendered very nicely, as is shown in this example:
# first item # second item #: <code><pre>one multiline comment</pre></code> # third item
will render as:
- first item
- second item one
multiline comment
- third item # list starts anew here.
Is there any way to contain the line-breaks in a <pre></pre> elements, without messing up the list's layout/numbering?
thanks, Bram
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org