94 lines
4.2 KiB
PHP
94 lines
4.2 KiB
PHP
<?php
|
||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||
// original author(s).
|
||
//
|
||
// This code is distributed in the hope that it will be useful,
|
||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||
// License for more details.
|
||
//
|
||
// File: ./includes/transtab_refbase_html.inc.php
|
||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_refbase_html.inc.php $
|
||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||
//
|
||
// Created: 28-May-06, 18:24
|
||
// Modified: $Date: 2008-10-30 17:19:48 +0000 (Thu, 30 Oct 2008) $
|
||
// $Author: msteffens $
|
||
// $Revision: 1288 $
|
||
|
||
// Search & replace patterns for conversion from refbase markup to HTML markup & entities. Converts refbase fontshape markup (italic, bold, underline)
|
||
// and super- and subscript into HTML commands, greek letters get converted into the respective HTML entity codes.
|
||
// Search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes.
|
||
|
||
global $patternModifiers; // defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
|
||
|
||
$transtab_refbase_html = array(
|
||
|
||
"/__(?!_)(.+?)__/" => "<u>\\1</u>", // the pattern for underline (__...__) must come before the one for italic (_..._)
|
||
"/_(.+?)_/" => "<i>\\1</i>",
|
||
"/\\*\\*(.+?)\\*\\*/" => "<b>\\1</b>",
|
||
"/\\[super:(.+?)\\]/i" => "<sup>\\1</sup>",
|
||
"/\\[sub:(.+?)\\]/i" => "<sub>\\1</sub>",
|
||
"/\\[permil\\]/" => "‰",
|
||
"/\\[infinity\\]/" => "∞",
|
||
"/\\[alpha\\]/" => "α",
|
||
"/\\[beta\\]/" => "β",
|
||
"/\\[gamma\\]/" => "γ",
|
||
"/\\[delta\\]/" => "δ",
|
||
"/\\[epsilon\\]/" => "ε",
|
||
"/\\[zeta\\]/" => "ζ",
|
||
"/\\[eta\\]/" => "η",
|
||
"/\\[theta\\]/" => "θ",
|
||
"/\\[iota\\]/" => "ι",
|
||
"/\\[kappa\\]/" => "κ",
|
||
"/\\[lambda\\]/" => "λ",
|
||
"/\\[mu\\]/" => "μ",
|
||
"/\\[nu\\]/" => "ν",
|
||
"/\\[xi\\]/" => "ξ",
|
||
"/\\[omicron\\]/" => "ο",
|
||
"/\\[pi\\]/" => "π",
|
||
"/\\[rho\\]/" => "ρ",
|
||
"/\\[sigmaf\\]/" => "ς",
|
||
"/\\[sigma\\]/" => "σ",
|
||
"/\\[tau\\]/" => "τ",
|
||
"/\\[upsilon\\]/" => "υ",
|
||
"/\\[phi\\]/" => "φ",
|
||
"/\\[chi\\]/" => "χ",
|
||
"/\\[psi\\]/" => "ψ",
|
||
"/\\[omega\\]/" => "ω",
|
||
"/\\[Alpha\\]/" => "Α",
|
||
"/\\[Beta\\]/" => "Β",
|
||
"/\\[Gamma\\]/" => "Γ",
|
||
"/\\[Delta\\]/" => "Δ",
|
||
"/\\[Epsilon\\]/" => "Ε",
|
||
"/\\[Zeta\\]/" => "Ζ",
|
||
"/\\[Eta\\]/" => "Η",
|
||
"/\\[Theta\\]/" => "Θ",
|
||
"/\\[Iota\\]/" => "Ι",
|
||
"/\\[Kappa\\]/" => "Κ",
|
||
"/\\[Lambda\\]/" => "Λ",
|
||
"/\\[Mu\\]/" => "Μ",
|
||
"/\\[Nu\\]/" => "Ν",
|
||
"/\\[Xi\\]/" => "Ξ",
|
||
"/\\[Omicron\\]/" => "Ο",
|
||
"/\\[Pi\\]/" => "Π",
|
||
"/\\[Rho\\]/" => "Ρ",
|
||
"/\\[Sigma\\]/" => "Σ",
|
||
"/\\[Tau\\]/" => "Τ",
|
||
"/\\[Upsilon\\]/" => "Υ",
|
||
"/\\[Phi\\]/" => "Φ",
|
||
"/\\[Chi\\]/" => "Χ",
|
||
"/\\[Psi\\]/" => "Ψ",
|
||
"/\\[Omega\\]/" => "Ω",
|
||
"/(?:\"|")(.+?)(?:\"|")/" => "“\\1”",
|
||
"/ +- +/" => " – ",
|
||
// "/<2F>/$patternModifiers" => "–"
|
||
// Note that for UTF-8 based systems, '$patternModifiers' contains the "u" (PCRE_UTF8) pattern modifier which should cause PHP/PCRE
|
||
// to treat pattern strings as UTF-8 (otherwise this conversion pattern would garble UTF-8 characters such as "<22>"). However, the
|
||
// "<22>" character still seems to cause PREG compilation errors on some UTF8-based systems, which is why the line has been commented
|
||
// out (it should work fine for a latin1-based system, though).
|
||
|
||
);
|
||
|
||
?>
|