Files
luos/thirdparty/html2ps_pdf/inline.content.builder.php
Paula Quispe 9eb7d6cac2 HOR-2689
2017-08-03 17:00:30 -04:00

43 lines
957 B
PHP

<?php
require_once(HTML2PS_DIR.'error.php');
/**
* See CSS 2.1 16.6.1 The 'white-space' processing model
*/
class InlineContentBuilder {
function InlineContentBuilder() {
}
function add_line_break(&$box, &$pipeline) {
$break_box =& new BRBox();
$break_box->readCSS($pipeline->getCurrentCSSState());
$box->add_child($break_box);
}
function build(&$box, $text, &$pipeline) {
error_no_method('build', get_class($this));
}
function break_into_lines($content) {
return preg_split('/[\r\n]/u', $content);
}
function break_into_words($content) {
return preg_split('/ /u', $content);
}
function collapse_whitespace($content) {
return preg_replace('/[\r\n\t ]+/u', ' ', $content);
}
function remove_leading_linefeeds($content) {
return preg_replace('/^ *[\r\n]+/u', '', $content);
}
function remove_trailing_linefeeds($content) {
return preg_replace('/[\r\n]+$/u', '', $content);
}
}
?>