User:PerfektesChaos/js/WikiSyntaxTextMod/flow/selective

WikiSyntaxTextModSyntax polishing → Step 5

Protecting regions

The fifth step protects further areas (after nowiki, codes, and link targets etc.) against general modifications.

This is not always necessary and will be executed only if there is a reason.

Within protected areas nothing is searched, so nothing found or even worse: replaced.


Necessity of protection

There are two levels:

  1. Hide from further analysis
    Comments, nowiki and syntaxhighlight
    These regions influence further interpretation and processing of wikitext.
  2. Protection against user defined modifications and some changes triggered internally.

In the first case the referred ranges are always protected, while parts deserve to be protected only if later acivity has been scheduled.

Protection of sections with coded information

Ranges with coded information are to be skipped.

Sequence and identification of protected ranges
Begin Content End
<!--
<hiddentext>
Comment -->
</hiddentext>
<nowiki> No wiki formatting </nowiki>
<syntaxhighlight…>
<source…>
syntaxhighlight </syntaxhighlight>
</source>
<hiero>
<imagemap>
<inputbox>
<math>
<poem>
<pre>
<timeline>
hieroglyphs
link

sensitive images
input fields
math
poem
preformatted
time line

</hiero>
</imagemap>
</inputbox>
</math>
</pre>
</timeline>
space at beginning of line preformatted text line end
(last line in block)
<code> code </code>
<tt> type writer (monospace) </tt>
<dfn>
<kbd>
<samp>
code </dfn>
</kbd>
</samp>

If in doubt the extension is spread in conservating direction; may be wider than actually intended. If end marks have not been found, since illegal nesting happened in source text, the range is extended at maximum, in extreme cases until end of the entire wikitext.

Keys for sorting of categories and the entire DEFAULTSORT are always protected against user defined modifications.

Since the processing order brings tags into standardised form first and consecutively protected regions are built from those tags, it is possible to show scaring examples for bad formatting of wikisyntax or similar ML only by &lt; or enclosing by <syntaxhighlight>.

It is reasonable to modify changed URL and wikilinks of moved pages or disambiguation pages. In particular cases it is meaningful to modify link targets which have been protected before. However, these link targets have to be protected against spelling correction and typographic refinement.

Identification of link target ranges
Begin Content End
after
[[
wikilink (internal / external)
including [[File:
(link target only)
before |
or before ]
or end of line
after[ at
[//
[http://
[https://
[ftp://
URL before ]
or before space
or end of line
http://
https://
ftp://
one of < | >
or space
or end of line[1]
end of line or space
before File: or file name
within
<gallery…>
|
or end of line
after
{{
template name last non-space
before | or }}
or end of line
first character
of parameter
after =
media ID
in template[2]
last character
of file extension
before | or }}

Syntax elements of template transclusion (parameter names with | and =) might be protected as well, but not the parameter values.

Remarks

  1. ^ The MediaWiki parser currently interpretes a punctuation character (like .;),?) at the end of an unbracketed URL as not belonging to URL, despite it is a regular URL character according to HTTP/RFC. This needs to be investigated and should be put into brackets.
  2. ^ Parameter values ending on a file name extension (with dot .).
    These are currently: avi css djvu doc flac gif jpeg jpg js mid mp3 odt og[agv] pdf png svg tiff? wav xcf xls xml (case insensitive).

[ German page ]

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.