This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Template talk:KernelBox

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
Note
This is a talk page. Please add newer comments below older ones, and sign your comments using four tildes (~~~~). When adding a new section (at the bottom of the page), please mark it as "open for discussion" by using {{talk|open}} so it will show up in the list of open discussions.

Indentation of first line of content

Talk status
This discussion is done.

KernelBox template with 1= ignores indentation for the first line of content. For example the following KernelBox with 1= and 4 spaces of indentation for each line;

{{KernelBox|1=
    Some kernel options.
    More kernel options.    
}}

will display as:

KERNEL
Some kernel options.
    More kernel options.

Is this a bug in the template? --BT (talk) 10:56, 30 May 2017 (UTC)

Hmm... It would seem that trim is being called on whitespace at the beginning and the ends of the line automatically on parameters passed to templates. I can look into this further to see if there a work around that's more consistent than using <pre> tags for formatting. --Maffblaster (talk) 12:34, 30 May 2017 (UTC)

I completely forgot that I raised the same issue a couple years ago against the FileBox template. See the talk page Template_talk:FileBox. The correct way to preserve the indent on the first line is to use:

{{KernelBox|1=<nowiki />
    Some kernel options.
    More kernel options.
}}

which display as:

KERNEL
    Some kernel options.
    More kernel options.

This is only necessary if the first line has an indent, otherwise using 1= is sufficient. It also preserves syntax highlighting for FileBox. --BT (talk) 07:44, 3 June 2017 (UTC)

1= causes highlighting errors

Talk status
This discussion is still ongoing as of September 21, 2017.

Using the 1= parameter (e.g. this edit) causes the article to be added to category Pages with syntax highlighting errors. --Charles17 (talk) 07:01, 21 September 2017 (UTC)

This is happening all over the place for me too, even for very simple examples (e.g., please see the FileBox talk page). --Sakaki (talk) 09:13, 21 September 2017 (UTC)

At first glance seems to be something happening on the wiki's backend, but I haven't looked too closely yet. I've been needing to do updates to wiki extensions for a while now which I will try hard to get some performed this weekend (Friday/Saturday). Please use proper KernelBox syntax even with the 'Pages with syntax highlighting errors' message displaying. This is proper syntax even if wiki is warning about it. I'll add a message to the front page of the wiki once I get things updated. Kind regards, --Maffblaster (talk) 17:08, 21 September 2017 (UTC)