You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
904 B
37 lines
904 B
<?php |
|
/** |
|
* Plugin Ortho-Typographie |
|
* (c) 2013 cedric |
|
* Licence GNU/GPL |
|
*/ |
|
|
|
if (!defined("_ECRIRE_INC_VERSION")) return; |
|
|
|
if (!function_exists('inc_lien')){ |
|
/** |
|
* pour les liens, on transforme les guill francais « » des titres en guill de second niveau |
|
* |
|
* @return mixed |
|
*/ |
|
function inc_lien() { |
|
static $config; |
|
if (is_null($config)) |
|
$config = lire_config("orthotypo/"); |
|
|
|
if (!function_exists('inc_lien_dist')){ |
|
include_spip('inc/lien'); |
|
} |
|
// recuperer le resultat normal |
|
$args = func_get_args(); |
|
$typo = call_user_func_array('inc_lien_dist', $args); |
|
|
|
if (!isset($config['guillemets']) OR $config['guillemets']){ |
|
// si on n'avait pas precise de titre, changer les guill du titre auto |
|
if ($args[1] === '' AND strpos($typo,"«")!==false) |
|
$typo = preg_replace(',«( )?(.*?)( )?»,S', '“\2”', $typo); |
|
} |
|
|
|
// et hop |
|
return $typo; |
|
} |
|
} |