Merge pull request #93 from viktorminko/fix-rtl-spaces-reversion

Fix of issue with html tags inside RTL languages
This commit is contained in:
Nicola Asuni 2018-09-14 13:00:13 +01:00 committed by GitHub
commit 5d6afea865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18328,7 +18328,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
}
// text
$this->htmlvspace = 0;
if ((!$this->premode) AND $this->isRTLTextDir()) {
$isRTLString = preg_match(TCPDF_FONT_DATA::$uni_RE_PATTERN_RTL, $dom[$key]['value']) || preg_match(TCPDF_FONT_DATA::$uni_RE_PATTERN_ARABIC, $dom[$key]['value']);
if ((!$this->premode) AND $this->isRTLTextDir() AND !$isRTLString) {
// reverse spaces order
$lsp = ''; // left spaces
$rsp = ''; // right spaces
@ -18343,7 +18344,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
if ($newline) {
if (!$this->premode) {
$prelen = strlen($dom[$key]['value']);
if ($this->isRTLTextDir()) {
if ($this->isRTLTextDir() AND !$isRTLString) {
// right trim except non-breaking space
$dom[$key]['value'] = $this->stringRightTrim($dom[$key]['value']);
} else {