확장 기능:SyntaxHighlight

This page is a translated version of the page Extension:SyntaxHighlight and the translation is 22% complete.
이 extension 확장기능은 미디어위키 1.21 이상에서 포함됩니다. 따라서 다시 다운로드하지 않아도 됩니다. 하지만 여전히 제공되는 별개의 지침을 따라야 합니다.
소스 편집기를 이용할 때 구문 강조가 필요하다면 CodeMirror 확장기능이나 Remember the dot, Cacycle 사용자 스크립트를 사용하십시오.
미디어위키 확장 기능 매뉴얼
OOjs UI icon advanced-invert.svg
SyntaxHighlight
출시 상태: 안정
SyntaxHighlighting with Pygments.png
구현 태그
설명 위키 문서에서 소스 코드의 구문이 강조되도록 합니다.
만든이
  • Brion Vibber,
  • Tim Starling,
  • Rob Church,
  • Ori Livneh
최신 버전 continuous updates
호환성 정책 Master maintains backward compatibility.
MediaWiki 1.25+
데이터베이스 변경 아니오
라이선스 GNU General Public License 2.0 or later
다운로드
README
  • $wgPygmentizePath
‎<syntaxhighlight>
SyntaxHighlight 확장 기능 번역 (translatewiki.net에서 가능한 경우)

사용법과 버전 매트릭스를 확인합니다.

이슈 미해결 작업 · 버그 보고

SyntaxHighlight 확장 기능은 이전에는 SyntaxHighlight_GeSHi라는 이름이었으며 ‎<syntaxhighlight> 태그를 사용했을 때 소스 코드를 강조해 줍니다. Pygments 라이브러리를 사용하였고 100개가 넘는 프로그래밍 언어, 마크업 언어, SQL, 쉘 스크립트 같은 다양한 언어를 지원합니다.

‎<pre><poem > 태그처럼 텍스트를 정확히 입력한 그대로 렌더링됩니다.

The SyntaxHighlight extension does not work on hardened wiki installations due to lack of proc_open, shell_exec and friends. See 작업 T250763.

사용법

설치하면 위키 페이지에서 "syntaxhighlight" 태그 사용할 수 있습니다. 예를 들어

def quick_sort(arr):
	less = []
	pivot_list = []
	more = []
	if len(arr) <= 1:
		return arr
	else:
		pass

미디어 위키 마크업의 결과입니다.

‎<syntaxhighlight lang="python" line>
def quick_sort(arr):
	less = []
	pivot_list = []
	more = []
	if len(arr) <= 1:
		return arr
	else:
		pass
‎</syntaxhighlight>
MediaWiki 1.16이전의 구버전에서는 ‎<source> 태그로 입력해야 합니다.

아직은 지원되지만 추천하지는 않습니다. ‎<syntaxhighlight>로 작성해야합니다.

서식

보여지는 코드가 너무 크다면 MediaWiki:Common.css 페이지로 설정하세요.

/* 여기 입력된 CSS는 모든 스킨에 적용됩니다. */
.mw-highlight pre {
	font-size: 90%;
}

위 섹션에 border: 1px dashed blue;와 같은 줄을 삽입하여 코드 블록을 테두리로 묶을 수 있습니다. 위의 섹션에 font-family: "Courier New", monospace;와 같은 코드를 삽입하여 사용 된 폰트를 조정할 수도 있습니다.

구문 강조에 오류가 있는 문서

‎<syntaxhighlight> 태그에 잘못된 lang 속성값을 가지는 문서들을 추적용 분류에 분류합니다. The message key MediaWiki:syntaxhighlight-error-category determines the category name; on this wiki it is Category:Pages with syntax highlighting errors.

The most common error that leads to pages being tagged with this category is a ‎<syntaxhighlight> tag with no lang attribute at all, because older versions of this extension supported the definition of $wgSyntaxHighlightDefaultLang. These can typically either be replaced with ‎<pre>, or lang="bash" or lang="text" can be added to the tag.

The category may also be added, and the content will not be highlighted, if there are more than 1000 lines or more than 100 kB text.[1]

변수

lang

The lang="name" attribute defines what lexer should be used. The language affects how the extension highlights the source code. See the section Supported languages for details of supported languages.

def quick_sort(arr):
    less = []
<syntaxhighlight lang="python">
...
</syntaxhighlight>

Specifying an invalid or unknown name will tag the page with a tracking category. See the section Syntax highlighting error category in this page for details.

line

The line attribute enables line numbers.

def quick_sort(arr):
	less = []
<syntaxhighlight lang="python" line>
...
</syntaxhighlight>

start

The start attribute (in combination with line) defines the first line number of the code block. For example, line start="55" will make line numbering start at 55.

def quick_sort(arr):
    less = []
<syntaxhighlight lang="python" line start="55">
...
</syntaxhighlight>

highlight

The highlight attribute specifies one or more lines that should be marked (by highlighting those lines with a different background color). You can specify multiple line numbers separated by commas (for example, highlight="1,4,8") or ranges using two line numbers and a hyphen (for example, highlight="5-7").

The line number specification ignores any renumbering of the displayed line numbers with the start attribute.
def quick_sort(arr):
    less = []
    pivot_list = []
    more = []
    if len(arr) <= 1:
        return arr

is the result of

<syntaxhighlight lang="python" line start="3" highlight="1,5-7">
...
</syntaxhighlight>

inline

미디어위키 버전:
1.26

The attribute indicates that the source code should be inline as part of a paragraph (as opposed to being its own block). This option is available starting with MediaWiki 1.26.

Using the "enclose" parameter is deprecated; if set to "none", it should be replaced with inline; otherwise, it can be removed entirely.
Line breaks can occur at any space between the opening and closing tags unless the source code is marked non-breakable with class="nowrap" (on those wikis that support it; see below) or style="white-space:nowrap".

For example:

The following lambda x: x * 2 is a lambda expression in Python.

Is the result of:

The following <syntaxhighlight lang="python" inline>lambda x: x * 2</syntaxhighlight> is a [[w:Lambda (programming)|lambda expression]] in Python.

class

When inline is used, class="nowrap" (on those wikis that support it; not on MediaWiki itself) specifies that line breaks should not occur at spaces within the code block.

For example:

Without class="nowrap":

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxlambda x: x * 2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

With style="white-space:nowrap":

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxlambda x: x * 2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

style

The style attribute allows CSS attributes to be included directly. This is equivalent to enclosing the block in a ‎<div> (not ‎<span>) tag. The tab‑size attribute cannot be specified this way; it requires an enclosing ‎<span> tag as described below under Advanced.

For example:

def quick_sort(arr):
	less = []
	pivot_list = []
	more = []
	if len(arr) <= 1:
		return arr
	else:
		pass

Is the result of:

‎<syntaxhighlight lang="python" style="border: 3px dashed blue;">
def quick_sort(arr):
	less = []
	pivot_list = []
	more = []
	if len(arr) <= 1:
		return arr
	else:
		pass
‎</syntaxhighlight>

지원되는 언어들

Pygments 라이브러리는 백개가 넘는 컴퓨터 언어나 파일 형식을 지원합니다. 2020년 1월 기준 목록입니다

프로그래밍 언어

  • ActionScript
  • Ada
  • Agda
  • Alloy
  • AMPL
  • ANTLR
  • APL
  • AppleScript
  • Assembly (여러 형식)
  • Asymptote
  • Augeas
  • AutoIt
  • Awk
  • BBC Basic
  • Befunge
  • BlitzBasic
  • Boa
  • Boo
  • Boogie
  • BrainFuck
  • C, C++ (Arduino같은 방언 포함)
  • C#
  • Chapel
  • Charm++ CI
  • Cirru
  • Clay
  • Clean
  • Clojure
  • CoffeeScript
  • ColdFusion
  • Common Lisp
  • Component Pascal
  • Coq
  • Croc (MiniD)
  • Cryptol (Literate Cryptol 포함)
  • Crystal
  • Cypher
  • Cython
  • D
  • Dart
  • DCPU-16
  • Delphi
  • Dylan (콘솔 포함)
  • Eiffel
  • Elm
  • Emacs Lisp
  • Email
  • Erlang (셸 세션 포함)
  • Ezhil
  • Factor
  • Fancy
  • Fantom
  • Fennel
  • FloScript
  • Forth
  • Fortran
  • FreeFEM++
  • F#
  • GAP
  • Gherkin (Cucumber)
  • GLSL 셰이더
  • Golo
  • Gosu
  • Groovy
  • Haskell (Literate Haskell 포함)
  • HLSL
  • HSpec
  • Hy
  • IDL
  • Idris (Literate Idris 포함)
  • Igor Pro
  • Io
  • Jags
  • Java
  • JavaScript
  • Jasmin
  • Jcl
  • Julia
  • Kotlin
  • Lasso (incl. templating)
  • Limbo
  • LiveScript
  • Logtalk
  • Logos
  • Lua
  • Mathematica
  • Matlab
  • Modelica
  • Modula-2
  • Monkey
  • Monte
  • MoonScript
  • Mosel
  • MuPad
  • NASM
  • Nemerle
  • NesC
  • NewLISP
  • Nimrod
  • Nit
  • Notmuch
  • NuSMV
  • Objective-C
  • Objective-J
  • Octave
  • OCaml
  • Opa
  • OpenCOBOL
  • ParaSail
  • Pawn
  • PHP
  • Perl 5
  • Pike
  • Pony
  • PovRay
  • PostScript
  • PowerShell
  • Praat
  • Prolog
  • Python (incl. console sessions and tracebacks)
  • QBasic
  • Racket
  • Raku a.k.a. Perl 6
  • REBOL
  • Red
  • Redcode
  • Rexx
  • Ride
  • Ruby (incl. irb sessions)
  • Rust
  • S, S-Plus, R
  • Scala
  • Scdoc
  • Scheme
  • Scilab
  • SGF
  • Shell scripts (Bash, Tcsh, Fish)
  • Shen
  • Silver
  • Slash
  • Slurm
  • Smalltalk
  • SNOBOL
  • Snowball
  • Solidity
  • SourcePawn
  • Stan
  • Standard ML
  • Stata
  • Swift
  • Swig
  • SuperCollider
  • Tcl
  • Tera Term language
  • TypeScript
  • TypoScript
  • USD
  • Unicon
  • Urbiscript
  • Vala
  • VBScript
  • Verilog, SystemVerilog
  • VHDL
  • Visual Basic.NET
  • Visual FoxPro
  • Whiley
  • Xtend
  • XQuery
  • Zeek
  • Zephir
  • Zig

Template languages

  • Angular templates
  • Cheetah templates
  • ColdFusion
  • Django / Jinja templates
  • ERB (Ruby templating)
  • Evoque
  • Genshi (the Trac template language)
  • Handlebars
  • JSP (Java Server Pages)
  • Liquid
  • Myghty (the HTML::Mason based framework)
  • Mako (the Myghty successor)
  • Slim
  • Smarty templates (PHP templating)
  • Tea
  • Twig

Other markup

  • Apache config files
  • Apache Pig
  • BBCode
  • CapDL
  • Cap'n Proto
  • CMake
  • Csound scores
  • CSS
  • Debian control files
  • Diff files
  • Dockerfiles
  • DTD
  • EBNF
  • E-mail headers
  • Extempore
  • Flatline
  • Gettext catalogs
  • Gnuplot script
  • Groff markup
  • Hexdumps
  • HTML
  • HTTP sessions
  • IDL
  • Inform
  • INI-style config files
  • IRC logs (irssi style)
  • Isabelle
  • JSGF notation
  • JSON, JSON-LD
  • Lean theorem prover
  • Lighttpd config files
  • Linux kernel log (dmesg)
  • LLVM assembly
  • LSL scripts
  • Makefiles
  • MoinMoin/Trac Wiki markup
  • MQL
  • MySQL
  • NCAR command language
  • Nginx config files
  • Nix language
  • NSIS scripts
  • Notmuch
  • POV-Ray scenes
  • Puppet
  • QML
  • Ragel
  • Redcode
  • ReST
  • Roboconf
  • Robot Framework
  • RPM spec files
  • Rql
  • RSL
  • Scdoc
  • SPARQL
  • SQL, also MySQL, SQLite
  • Squid configuration
  • TADS 3
  • Terraform
  • TeX
  • Thrift
  • TOML
  • Treetop grammars
  • USD (Universal Scene Description)
  • Varnish configs
  • VGL
  • Vim Script
  • WDiff
  • Windows batch files
  • XML
  • XSLT
  • YAML
  • Windows Registry files

For accurate language codes, see complete details in the Pygments document and there are some mappings for some language names which were supported by GeSHi (full list).

Pygments does not yet provide a "wikitext" or "mediawiki" lexer (phab:T29828). Use "html+handlebars" or "moin" instead.
Since MediaWiki 1.37 more lexers were added with the update of pygments to version 2.10.0 as detailed with 작업 T280117.

Lexers previously supported by GeSHi

Below is a partial list of languages that GeSHi could highlight, with strike-through for languages no longer supported after the switch to Pygments.

Lexers previously supported by GeSHi
Code Language
4cs GADV 4CS
6502acme MOS 6502 (6510) ACME Cross Assembler
6502kickass MOS 6502 (6510) Kick Assembler
6502tasm MOS 6502 (6510) TASM/64TASS
68000devpac Motorola 68000 - HiSoft Devpac ST 2 Assembler
abap ABAP
actionscript ActionScript
actionscript3 ActionScript3
ada Ada
algol68 ALGOL 68
apache Apache Configuration
applescript AppleScript
apt_sources Apt sources
arm ARM Assembler
asm Assembly
asp Active Server Pages (ASP)
asymptote Asymptote
autoconf Autoconf
autohotkey AutoHotkey
autoit AutoIt
avisynth AviSynth
awk AWK
bascomavr BASCOM AVR
bash Bash
basic4gl Basic4GL
bf Brainfuck
bibtex BibTeX
blitzbasic Blitz BASIC
bnf Backus–Naur Form
boo Boo
c C
c_loadrunner C Loadrunner
c_mac C (Mac)
caddcl AutoCAD DCL
cadlisp AutoLISP
cfdg CFDG
cfm ColdFusion Markup Language
chaiscript ChaiScript
cil Common Intermediate Language (CIL)
clojure Clojure
cmake CMake
cobol COBOL
coffeescript CoffeeScript
cpp C++
cpp-qt C++ (Qt toolkit)
csh C shell
csharp C#
css Cascading Style Sheets (CSS)
cuesheet Cue sheet
d D
dart Dart
dcl Data Control Language
dcpu16 DCPU-16
dcs Data Conversion System
delphi Delphi
diff Diff
div DIV
dosbatch DOS batch file
dot DOT
e E
ebnf Extended Backus–Naur Form
ecmascript ECMAScript
eiffel Eiffel
email Email (mbox \ eml \ RFC format)
epc Enerscript
erlang Erlang
euphoria Euphoria
f1 Formula One
falcon Falcon
fo FO
fortran Fortran
freebasic FreeBASIC
freeswitch FreeSWITCH
fsharp Fsharp
gambas Gambas
gdb GDB
genero Genero
genie Genie
gettext gettext
glsl OpenGL Shading Language (GLSL)
gml Game Maker Language (GML)
gnuplot gnuplot
go Go
groovy Groovy
gwbasic GW-BASIC
haskell Haskell
haxe Haxe
hicest HicEst
hq9plus HQ9+
html4strict HTML
html5 HTML5
icon Icon
idl Uno IDL
ini INI
inno Inno
intercal INTERCAL
io Io
j J
java Java
java5 Java(TM) 2 Platform Standard Edition 5.0
javascript JavaScript
jquery jQuery
kixtart KiXtart
klonec Klone C
klonecpp Klone C++
kotlin Kotlin
ksh Korn shell
latex LaTeX
lb Liberty BASIC
ldif LDAP Data Interchange Format
lisp Lisp
llvm LLVM
locobasic Locomotive BASIC
logtalk Logtalk
lolcode LOLCODE
lotusformulas Formula language
lotusscript LotusScript
lscript LightWave 3D
lsl2 Linden Scripting Language
lua Lua
magiksf Magik
m68k Motorola 68000 Assembler
make make
mapbasic MapBasic
matlab MATLAB M
mirc mIRC scripting language
mmix MMIX
modula2 Modula-2
modula3 Modula-3
mpasm Microchip Assembler
mxml MXML
mysql MySQL
nagios Nagios
netrexx NetRexx
newlisp NewLISP
nsis Nullsoft Scriptable Install System (NSIS)
oberon2 Oberon-2
objc Objective-C
objeck Objeck
ocaml OCaml
ocaml-brief OCaml
octave Octave
oobas LibreOffice/OpenOffice.org Basic
oorexx Object REXX
oracle11 Oracle 11 SQL
oracle8 Oracle 8 SQL
oxygene Oxygene
oz Oz
parasail ParaSail
parigp PARI/GP
pascal Pascal
pcre Perl Compatible Regular Expressions
per per
perlpl
Perl
perl6
pl6
raku
Perl 6
pf PF
php PHP
php-brief PHP (deprecated – no colors, odd framing)
pic16 PIC assembly language
pike Pike
pixelbender Pixel Bender
pli PL/I
plsql PL/SQL
postgresql PostgreSQL
postscript PostScript
povray Persistence of Vision Raytracer
powerbuilder PowerBuilder
powershell Windows PowerShell
proftpd ProFTPD
progress OpenEdge Advanced Business Language
prolog Prolog
properties Properties file
providex ProvideX
purebasic PureBasic
pycon Python
pys60 PyS60
python
py
python3
py3
Python
python2
py2
Python 2
q Q
qbasic QBasic/QuickBASIC
rails Rails
rebol Rebol
reg Windows Registry
rexx Rexx
robots robots.txt
rpmspec RPM Spec files
rsplus R
ruby Ruby
sas SAS
scala Scala
scheme Scheme
sh
shell
shell-session
Shell Script (POSIX)
scilab Scilab
sdlbasic SdlBasic
smalltalk Smalltalk
smarty Smarty
spark SPARK
sparql SPARQL
sql SQL
stonescript StoneScript (Scripting language for ShiVa3D)
systemverilog SystemVerilog
tcsh Tcsh
tcl Tcl
teraterm Tera Term
text Plain text
thinbasic thinBasic
ts TypeScript
tsql Transact-SQL
typoscript TypoScript
unicon Unicon
upc Unified Parallel C
urbi URBI
uscript UnrealScript
vala Vala
vb Visual Basic
vbnet Visual Basic .NET
vedit VEDIT
verilog Verilog
vhdl VHDL
vim Vim script
visualfoxpro Visual FoxPro
visualprolog Visual Prolog
whitespace Whitespace
whois Whois
winbatch Winbatch
xml XML
xorg_conf Xorg.conf
yaml YAML
xpp Microsoft Dynamics AX
z80 ZiLOG Z80 Assembler
zxbasic ZXBasic

설치

The version of this extension bundled with MediaWiki 1.31 requires Python version 3 (python3) to be installed on the server. This is a change from the version bundled with MediaWiki 1.30, which used Python version 2 (python). Note that the python3 binary must be installed in the execution PATH of the PHP interpreter.
Despite its update to Pygments (and away from GeSHi) and despite its updated name, this extension internally still uses the former file names as stated below.
  • 확장기능 폴더를 다운로드후, 다운로드 받은 폴더를 당신의 위키가 설치된 파일 주소의 extensions/ 폴더 안에 넣어 주세요.
  • git에서 설치할 경우, PHP 의존 기능을 설치하려면 Composer를 실행하여 확장 기능 디렉터리에 composer install --no-dev를 발행하십시오. (잠재적인 문제에 대해서는 작업 T173141 을 참고하십시오.)
  • 아래의 코드를 LocalSettings.php의 말미에 추가합니다:
    wfLoadExtension( 'SyntaxHighlight_GeSHi' );
    

리눅스에서, pygmentize 바이너리 실행 권한을 설정합니다. You can use an FTP client or the following shell command to do so:

chmod a+x /path/to/extensions/SyntaxHighlight_GeSHi/pygments/pygmentize
  •   완료 – 위키의 ‘Special:Version’에 이동해서, 확장기능이 올바르게 설치된 것을 확인합니다.

미디어위키 1.24 이하를 실행 중인 사용자에게:

위의 지시사항은 wfLoadExtension()을 사용하여 이 확장기능을 설치하는 새로운 방법을 기술한 것으로, wfLoadExtension( 'SyntaxHighlight_GeSHi' ); 대신 초기 버전(미디어위키 1.24 이하)에 이 확장기능을 설치하려면 다음을 사용해야 합니다:

require_once "$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php";
When installing from Git, please note that starting from MediaWiki 1.26, and ending with MediaWiki 1.31 this extension requires Composer.

So, after installation from Git change to the directory containing the extension e.g. "../extensions/SyntaxHighlight_GeSHi/" and run composer install --no-dev, or when updating: composer update --no-dev.

Alternatively as well as preferably add the line "extensions/SyntaxHighlight_GeSHi/composer.json" to the "composer.local.json" file in the root directory of your wiki like e.g.
{
	"extra": {
		"merge-plugin": {
			"include": [
				"extensions/SyntaxHighlight_GeSHi/composer.json"
			]
		}
	}
}

Now run composer update --no-dev.

Voilà!
  경고: When uploading the extension via FTP be sure to upload the pygments/pygmentize file with the transfer type binary.


설정

Linux
  • $wgPygmentizePath (optional): Absolute path to pygmentize of the Pygments package. The extension bundles the Pygments package and $wgPygmentizePath points to the bundled version by default, but you can point to a different version, if you want to. For example: $wgPygmentizePath = "/usr/local/bin/pygmentize";.
Windows
  • If you are hosting your MediaWiki on a Windows machine, you have to set the path for the Pygmentize.exe $wgPygmentizePath = "c:\\Python27\\Scripts\\pygmentize.exe";
    • If there is no pygmentize.exe run easy_install Pygments from command line inside the Scripts folder to generate the file.

If you are using the bundled pygmentize binary (extensions/SyntaxHighlight_GeSHi/pygments/pygmentize), make sure your webserver is permitted to execute it. If your host does not allow you to add executables to your web directory, install python-pygments and add $wgPygmentizePath = pygmentize to LocalSettings.php.

Troubleshooting

After updating to MediaWiki v1.26 and above, some users started reporting problems with the extension.

There could be cases, when some languages, such as Lua might not get highlighted and by turning on debugging, MediaWiki would throw out the error, Notice: Failed to invoke Pygments: /usr/bin/env: python3: No such file or directory.

  • Try pointing $wgPygmentizePath in LocalSettings.php towards an external pygmentize binary.
  • In shared hosting environments with cPanel, this can be done by setting up a new Python application through the "Setup Python App" menu, and activating the virtual environment for the app through SSH (source /virtualenv/python/3.5/bin/activate). After this, the Pygments module can be added to the Python app, for which navigate to the virtual environment path (cd virtualenv/python/3.5/bin/), download and install Pygments (./pip install Pygments) and then activate the module by adding "Pygments" under the "Existing applications" section of the "Setup Python App" menu. This will create the required file at path: virtualenv/python/3.5/bin/pygmentize
  • See phab:T128993 on this for further suggestions and information.
  • SELinux can also prevent the extension from running with an error similar to type=AVC msg=audit(1609598265.169:225924): avc: denied { execute } for pid=2360888 comm="bash" name="pygmentize" dev="dm-0" ino=50814399 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:httpd_user_content_t:s0 tclass=file permissive=0 in your audit.log. This can be allowed with setsebool -P httpd_unified 1

VisualEditor integration

The plugin enables direct editing with VisualEditor. A popup is opened when a user wants to edit syntaxhighlight sections. For this to work, VisualEditor must be installed and configured from the latest Git version, same for Parsoid. The feature may not work with older Parsoid versions. See Extension:SyntaxHighlight/VisualEditor for details

고급 사용

Unlike the ‎<pre> and ‎<code> tags, HTML character entities such as &nbsp; need not (and should not) have the & character escaped as &amp;. Like the ‎<pre> tag but unlike the ‎<code> tag, tags within the range (other than its own closing tag) need not have the < symbol escaped as &lt;, nor does wikitext need to be escaped with a ‎<nowiki> tag.

Furthermore, while ‎<pre> assumes tab stops every 8 characters and renders tabs using actual spaces when the rendered text is copied, ‎<syntaxhighlight> uses 4-space tab stops (except Internet Explorer, which uses 8) and preserves the tab characters in the rendered text; the latter may be changed using an enclosing ‎<span style="-moz-tab-size: nn; -o-tab-size: nn; tab-size: nn;"> tag (not ‎<div>, and not using its own style attribute). The -moz- prefix is required for Firefox (from version 4.0), and the -o- prefix is required for Opera (from version 10.60 to version 15).[2] (Note that the wiki editing box assumes 8-space tabs.) This applies only to actual saved pages; previews generated through an edit box or Special:ExpandTemplates may differ.

같이 보기

  • Extensions dependent on this one:
  • Alternative extensions:

각주