Extension:AltTag

AltTag extension makes it possible to create user-defined XML-style tags in any language aliasing other tags. For example this arabic tag <مرجع اسم="test" > will alias This code is 100% correct, but writing RTL with LTR makes it messy. With this extension you can do that like this: <مرجع اسم=الاسم فئة=الفئة> هنا محتوى  كبير  محتوى شيفرة  كبير   This is the main advantage, but there are other benefits as well.

Features

 * 1) This extension processes all tags and their attributes. It will also support the tags the content of which do not change, such as pre and nowiki.
 * 2)  Processing of all of these tags and their attributes is done before the parse stage. This minimizes mistakes and risk.
 * 3) It's possible to combine aliased and non-aliased tags, e.g. open tag with alias and close with unaliased name, and vice versa, or open with one alias and close with another.
 * 4) It's possible to define several aliases for the same tag.

Usage
After installing the extension, the alternate tag and alternate attributes are used the same way the original tag and attribute would be used.

Download Instructions
Please cut and paste the code found below and place it in. ''Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php''.

Installation
To install this extension, add the following to LocalSettings.php:

Configuration
To use AltTag you should define some information. You will find it in  file under this line.

Note: next examples is in Arabic.

Alternate Tags
You will find it under this line , It's an Array Its key is the Alternate Tag and the value is the real tag.

Example : Note: You can use mere than one alternate for one tag.

Nowikis Tags
It's any tag you want to keep alternates into it without any change, such as  and   or any tag you want.

You will find this under. It's an Array and its key is the Alternate Tag and the value is the real tag.

Example : Note : You can use more than one alternate for one real tag.

Alternates Attributes
You will find this under. It's an Array and its key is the Alternate attribute and the value is the real attribute.

Example : Note: You can use mere than one alternate for one attribute.

Extra Letters
If you using any non-English letters like Arabic, Chinese, Russian etc, you must insert it here. You will find it under

.Example : Warning : should not put anything other than Letters - no dots, no spaces, no signs, or anything else.

How it works
AltTag converts the alternate tags to real ones, and then transport the product to MediaWiki; this extension process the wikiText before converting it to HTML. So, if MediaWiki brings the revised version from the displayed version (or the other way around), this extension will not operate.

For developers
It's not a good explanation, but it's enough to understand how it works.

This extension work as this following steps:


 * 1) Get all of the tags to  specifically.
 * 2) Processing the tags in the array (so far did not edit wikitext) this way:
 * 1) Check if the tag is one if Nowikis Tags. If it was one of them  will be
 * 2) If  is   any tag will be added to   without any change untill Nowiki closing tag.
 * The tag will splitted to two parts, first part will be sent to  and anything after the tag name will be sent to   then add the resault into.
 * 3) Replacing process: Now all tags in Wikitest will be replaced by random replacement does not exist in wikitest.
 * 4) Returning process: Now the random will be replacement with fixed tag from, one time every time. This will return the tags to its correct places.
 * Why this all Replacing and Returning? Because this extension using RegEx pattern gets any tag, and it need to replace one time every time. Without using this replacements thing RegEx will working with first Tag every time.