summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2017-11-26 19:30:02 +0000
committerAndres Rey <[email protected]>2017-11-26 19:30:02 +0000
commitfd8cb90dd2f6a3116b1f78cf51efbba52a7b3028 (patch)
treefdb24f897a3274fb523cb4ac95614277d76fe228 /src
parentd761cac37772fe0384fe87c6cd2bf27c8732b1ad (diff)
Base for NodeUtility
Diffstat (limited to 'src')
-rw-r--r--src/NodeUtility.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/NodeUtility.php b/src/NodeUtility.php
new file mode 100644
index 0000000..8d412af
--- /dev/null
+++ b/src/NodeUtility.php
@@ -0,0 +1,31 @@
+<?php
+
+namespace andreskrey\Readability;
+
+
+/**
+ * Class NodeUtility
+ * @package andreskrey\Readability
+ */
+class NodeUtility
+{
+
+ /**
+ *
+ * Imported from the Element class on league\html-to-markdown
+ *
+ * @param $node
+ * @return mixed
+ */
+ public static function nextElement($node)
+ {
+ $next = $node;
+ while ($next
+ && $next->nodeName !== '#text'
+ && trim($next->textContent)) {
+ $next = $next->nextSibling;
+ }
+
+ return $next;
+ }
+} \ No newline at end of file