Skip to content

Commit

Permalink
Version 2.1:
Browse files Browse the repository at this point in the history
+ The “Nobr_hyphenNowrap” parameter, allowing hyphenated words to be rendered in nowrap mode, has been added.
  • Loading branch information
Ilyas Ronef committed Apr 16, 2014
1 parent babe955 commit b66ca8e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ddTypograph.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<?php
/**
* ddTypograph.php
* @version 2.0.2b (2014-03-26)
* @version 2.1 (2014-04-16)
*
* @desc Snippet for text typography.
*
* @uses EMT lib 3.2 (contains in archive).
*
* @param $text {string} - Text to correct. @required
* @param $Nobr_hyphenNowrap {0; 1} - Nowrap option for hyphenated words. Default: 1.
* @param $OptAlign {0; 1} - Optical alignment (hanging punctuation). Default: 0.
* @param $Text_paragraphs {0; 1} - Section signs and line breaks insertion. Default: 0.
* @param $Text_autoLinks {0; 1} - Section signs and line breaks insertion. Default: 0.
* @param $Text_autoLinks {0; 1} - Marking links (including email ones). Default: 0.
* @param $Etc_unicodeConvert {0; 1} - Convert html entities into Unicode (— instead of &mdash; etc.). Default: 1.
*
* @link http://code.divandesign.biz/modx/ddtypograph/2.0.2b
* @link http://code.divandesign.biz/modx/ddtypograph/2.1
*
* @copyright 2014, DivanDesign
* http://www.DivanDesign.biz
Expand All @@ -33,6 +34,7 @@
$ddTypograph = new EMTypograph();
}

$Nobr_hyphenNowrap = isset($Nobr_hyphenNowrap) && $Nobr_hyphenNowrap == 0 ? 'off' : 'on';
$OptAlign = isset($OptAlign) && $OptAlign == 1 ? 'on' : 'off';
$Text_paragraphs = isset($Text_paragraphs) && $Text_paragraphs == 1 ? 'on' : 'off';
$Text_autoLinks = isset($Text_autoLinks) && $Text_autoLinks == 1 ? 'on' : 'off';
Expand Down Expand Up @@ -66,7 +68,7 @@
//Обрамление пятисимвольных слов разделенных дефисом в неразрывные блоки TODO: Не удалось понять, что это, как и когда работает.
'Nobr.hyphen_nowrap_in_small_words' => 'off',
//Отмена переноса слова с дефисом
'Nobr.hyphen_nowrap' => 'on',
'Nobr.hyphen_nowrap' => $Nobr_hyphenNowrap,
//Использовать nowrap для неразрывных конструкций TODO: Тег «nobr» невалидный, а для «word-spacing» нет значения «nowrap», нужно использовать свойство «white-space».
'Nobr.nowrap' => 'on',

Expand Down

0 comments on commit b66ca8e

Please sign in to comment.