zigazou/french-typography
最新稳定版本:0.0.5
Composer 安装命令:
composer require zigazou/french-typography
包简介
Apply french typography to an HTML string
README 文档
README
FrenchTypography is a PHP module that automatically applies French typography rules to HTML code in UTF-8. This module improves the presentation and readability of texts by respecting the typographic standards in force in France.
Usage
<?php require('vendor/autoload.php'); use Zigazou\FrenchTypography\Correcteur; // This will return: Bonjour le monde « monde » ! $a = Correcteur::corriger('Bonjour le "monde"!'); // This will return: <div class="d">Bonjour le monde « monde » !</div> $b = Correcteur::corriger('<div class="d">Bonjour le "monde"!</div>', TRUE);
Features
- Addition of non-breaking thin spaces before double punctuation marks (: ; ? !)
- Convert English double quotes (" ") into French guillemets (« »)
- Adjustment of spaces in units of measurement
- Restore accents on uppercased first letters (Ecole → École)
- Corrects multiple consecutive exclamation/question mark
- Simple quotes are replaced with typographic quote
- <->, -> and <- are replaced with ↔, → and ←
- <=>, => and <= are replaced with ⇔, ⇒ and ⇐
- (c) and (C) are replaced with ©
- (r) and (R) are replaced with ®
- french phone numbers are formatted (0999999999 → 09 99 99 99 99)
- number followed by units will be separated by a no-break space
- Corrects missing œ ligatures (oeil → œil)
- Consecutive spaces are reduced to one space
- Leading and trailing spaces are trimmed
Installation
To install FrenchTypography, you can use Composer:
composer require zigazou/french-typography
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2024-06-12