Help:HTML in wikitext
Help:HTML in wikitext is a guide for users who wish to understand how HTML (Hypertext Markup Language) can be used within wikitext, the markup language used to edit pages in MediaWiki software, which powers websites like Wikipedia. This article provides an overview of the integration of HTML within wikitext, its limitations, and common use cases.
Overview[edit | edit source]
HTML is a standard markup language used for creating web pages. Wikitext, on the other hand, is designed to be a simpler way to format pages on MediaWiki websites. While wikitext handles most of the formatting needs on MediaWiki sites, there are instances where HTML is necessary for more complex formatting that wikitext cannot handle.
Usage[edit | edit source]
To use HTML in wikitext, simply insert the HTML code directly into the wikitext of a page. MediaWiki's parser will process the HTML along with the wikitext when the page is saved. However, not all HTML tags are allowed for security reasons; MediaWiki restricts the use of certain tags that could pose security risks or affect the site's structure and style.
Allowed HTML Tags[edit | edit source]
The following are examples of commonly used HTML tags that are allowed in MediaWiki:
- - Used to define a division or a section.
- - Used for grouping inline-elements.
- , ,
- Used for creating tables.
- Inserts a line break.- Defines a paragraph.
These tags can be used to enhance the layout and formatting options beyond what is available through standard wikitext.
Restricted HTML Tags[edit | edit source]
Tags that can interfere with the page layout, such as <script>, <style>, and <iframe>, are generally disallowed in user-edited content to prevent cross-site scripting (XSS) attacks and other security issues.
Common Use Cases[edit | edit source]
HTML is often used in wikitext for:
- Creating complex table layouts that are not supported by wikitext syntax.
- Applying inline styles to elements for which there is no direct wikitext equivalent.
- Inserting multimedia elements like embedded audio and video, though with restrictions on certain tags.
Limitations[edit | edit source]
While HTML expands the capabilities of wikitext, it also introduces potential for errors and security vulnerabilities. Users must be cautious when using HTML to ensure that they do not expose the site to security risks. Additionally, overuse of HTML can make the wikitext harder to read and maintain.
Conclusion[edit | edit source]
Understanding how to properly integrate HTML within wikitext can greatly enhance the functionality and appearance of pages on MediaWiki sites. However, it is important to use HTML judiciously and adhere to the guidelines and restrictions set forth by the MediaWiki community to maintain the security and integrity of the site.
Contributors: Prab R. Tumpati, MD