Skip to content

Commit

Permalink
Remove special treatment for text inside table's cells
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy-1 committed May 5, 2020
1 parent ce10909 commit 2e2a8ae
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/JATSParser/Body/Par.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ function __construct(\DOMElement $paragraph) {
public function getContent(): array {
return $this->content;
}
}
}
11 changes: 1 addition & 10 deletions src/JATSParser/Body/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,5 @@ private function extractTextNodeModifiers($paragraphContent) {
$this->type[] = $parentNode->nodeName;
}
}

/* text inside table cells needs special treatment */
if ($parentNode->nodeName == "p") {
$parentNodeOfParent = $parentNode->parentNode;
if ($parentNodeOfParent->nodeName == "th" || $parentNodeOfParent->nodeName == "td") {
$this->type[] = $parentNode->nodeName;
$this->extractTextNodeModifiers($parentNode);
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/JATSParser/HTML/Cell.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ public function setContent(JATSCell $cell) {
}
}
}
}
}
5 changes: 1 addition & 4 deletions src/JATSParser/HTML/Par.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ function __construct($nodeName = null) {

public function setContent(JATSPar $jatsPar) {

/* @var $jatsText JATSText */
foreach ($jatsPar->getContent() as $jatsText) {

HTMLText::extractText($jatsText, $this);

}
}
}
}

0 comments on commit 2e2a8ae

Please sign in to comment.