Permalink
Browse files

Features #7639 et #7641 - Images inline and paranumber filter

  • Loading branch information...
lnprieto committed Oct 8, 2018
1 parent 5d21c7b commit 1f1c408a4ab2abc6264d59a9f1c50e4ddc15809c
Showing with 5 additions and 1 deletion.
  1. +4 −0 lodel/scripts/teiparser.php
  2. +1 −1 lodel/scripts/textfunc.php
@@ -1641,6 +1641,10 @@ private function _parseFigure($attrs)
if(isset($this->_images[$id]))
$attrs['url'] = $this->_images[$id];
}
$rend = '';
if (!empty($attrs['rend']) && ($attrs['rend'] === 'inline')) {
$rend = ' class="'.$attrs['rend'].'"';
}
$text .= '<img src="'.$attrs['url'].'" alt="Image '.end($nb).'" id="'.$id.'"/>';
}
elseif(parent::END_ELEMENT === $this->nodeType && 'figure' === $this->localName)
@@ -947,7 +947,7 @@ function paranumber($texte, $styles='texte')
foreach($res as $node){
if(in_array($node->parentNode->localName, $illegalparents)
|| in_array($node->parentNode->parentNode->localName, $illegalparents)
|| $dom->query(".//img", $node)->length) continue;
|| ($dom->query(".//img", $node)->length && ($dom->query('.//img[@class="inline"]', $node)->length == 0))) continue;
++$count;
$parnum = $doc->createElement('span');
$parnum->setAttribute('class', 'paranumber');

0 comments on commit 1f1c408

Please sign in to comment.