Page MenuHomePhabricator

nowiki inside code tag, still messes with inside code tags
Closed, InvalidPublic

Description

Author: alpeterson

Description:
http://meta.wikimedia.org/wiki/User:AaronPeterson/pre_play

http://techbase.kde.org/Kdesrc-build/workingrclist

I attempt to insert this code into a wiki:

<code>
<nowiki>
#!/bin/bash

  1. warning, use at your own risk, I only block certain enviornment variables, you may have some senstive enviornment variables
  2. a better way to do this would be to include only the ones that we care about #
  3. This is released to public domain, and it sucks, but it might work, Aaron Peterson 2010

outputfile="enviornment_report_for_wiki_posting.txt"
echo "will output a file to $outputfile and open it in kate, please review and rmove private data"
echo " before before posting it at wiki: http://techbase.kde.org/index.php?title=Kdesrc-build/workingrclist"

if [ -f $outputfile ]
then

echo "output file already exists"

else
printf "\n==distro==\n<code>" > $outputfile

cat /etc/issue >> $outputfile

printf "</code>\n==env==\n<code>" >> $outputfile

env | grep -v XDG_SESSION_COOKIE  | grep -v SSH_AUTH_SOCK | grep -v SHELL_SESSION_ID | grep -v DBUS_SESSION_BUS_ADDRESS | grep -v XAUTHORITY | grep -v GPG_AGENT_INFO | grep -v SESSION_MANAGER | grep -v SSH_AGENT_PID | grep -v WINDOWID >> $outputfile

printf "</code>\n==packages==\n<code>" >> $outputfile

dpkg --get-selections >> $outputfile

printf "</code>\n==qt version==\n<code>" >> $outputfile
qmake -v >> $outputfile
printf "\n</code>\n"

kate $outputfile
fi

</nowiki>
</code>

in the older version, it does stuff with the close code and open tags while within the no wiki..

within the newer version (my meta user page) it ignores a lot of stuff.


Version: 1.16.x
Severity: enhancement

Details

Reference
bz24597

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:10 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz24597.
bzimport added a subscriber: Unknown Object (MLST).

This behaves as expected for me. If you put a <code> tag (or any other tag for that matter) inside a <nowiki>, it should be escaped.

As for the kde wiki- they installed [[mw:Extension:GeSHiCodeTag]] which messes with how code tags are handled. (there are other source highlighting extensions which are probably better and won't cause this issue).

Closing as invalid as this is the expected behaviour, and you only get the unexpected behaviour on the other wiki due to an extension.

alpeterson wrote:

Is there a tag that makes it so other things do not have to be escaped?

(I kind of thought that this was the nowiki tag)

yes, <nowiki> does escape other tags.

The issue is that the kde wiki installed an extension so that anything inside <code> tag is not interpreted but instead given to the geshi syntax highlighter for highlighting.

Thus in your example on kde wiki the <nowiki> is not interperted since it is inside a <code> tag.

In normal mediawiki where <code> is just treated like an html <code> and not a fancy syntax highlighting thing, <nowiki> works like expected.