text.gsub!(/<p>\{\{([<>]?)toc\}\}<\/p>/i) do
div_class = 'toc'
div_class << ' right' if $1 == '>'
+ div_class << ' left' if $1 == '<'
out = "<div class=\"#{div_class}\">"
@toc.each_with_index do |heading, index|
# remove wiki links from the item
line-height: 1.2em;
margin-bottom: 12px;
margin-right: 12px;
- float: left;
+ display: table
}
+* html div.wiki div.toc { width: 50%; } /* IE6 doesn't autosize div */
-div.wiki div.toc.right {
- float: right;
- margin-left: 12px;
- margin-right: 0;
-}
+div.wiki div.toc.right { float: right; margin-left: 12px; margin-right: 0; width: auto; }
+div.wiki div.toc.left { float: left; margin-right: 12px; margin-left: 0; width: auto; }
div.wiki div.toc a {
display: block;