[Home]ThinLine

UseModWiki | RecentChanges | Preferences

 $ThinLine    = 0;       # 1 = fancy <hr> tags,    0 = classic wiki <hr>

Implemented as

    if ($ThinLine) {
      s/----+/<hr noshade size=1>/g;
      s/====+/<hr noshade size=2>/g;
    } else {
      s/----+/<hr>/g;
    }
The use of ==== appears to conflict the WikiHeadings? as described here WikiPatches/ThinLineHeadingsConflict

I suggest the following implementation (please tidy up the perl)

    if ($ThinLine) {
      s/(^|\n)\s*--------+/<hr noshade style="height:5px">/g; ##TAB
      s/(^|\n)\s*-------+/<hr noshade style="height:4px">/g; ##TAB
      s/(^|\n)\s*------+/<hr noshade style="height:3px">/g; ##TAB
      s/(^|\n)\s*-----+/<hr noshade style="height:2px">/g; ##TAB
      s/(^|\n)\s*----+/<hr noshade style="height:1px">/g; ##TAB
    } else {
      s/----+/<hr>/g;
    }
Note that this change to ThinLine restrict lines to starting at the beginning of a line, ---- not just 4 or more hyphens anywhere in a line (like this one!).

Note: This version breaks down the way hr's are rendered and displayed. In other words, when you use indents or lists, your hr's will appear not after the list or indented text (behind the closing </dt> or </ul> or </ol> tags), but rather as the part of the last list item (before the closing tag). Use this a bit stripped down version to fix:

    if ($ThinLine) {
      s/--------+/<hr noshade style="height:5px">/g; ##TAB
      s/-------+/<hr noshade style="height:4px">/g; ##TAB
      s/------+/<hr noshade style="height:3px">/g; ##TAB
      s/-----+/<hr noshade style="height:2px">/g; ##TAB
      s/----+/<hr noshade style="height:1px">/g; ##TAB
    } else {
      s/----+/<hr>/g;
    }
-- UrbanSheep

This patch is nice. Thanks. I prefer size=5 over style="height:5px", however :-) --DavidAndel

''The way HTML is generated should be fixed IMHO, rather than removing the beginning of line stuff. Remember that CSS is the future of HTML formatting -- SimonDavis

UseModWiki | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited May 13, 2008 8:47 pm by MarkusLude (diff)
Search: