summaryrefslogtreecommitdiff
path: root/lib/htmlpurifier/library/HTMLPurifier/Injector/AutoParagraph.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-04-11 16:41:01 +0400
committerAndrew Dolgov <[email protected]>2011-04-11 16:41:01 +0400
commitf4f0f80d2118437e5047ba266f92d7acb3c38fb7 (patch)
treefb15f179dcd68b55613394ad864455f1796de555 /lib/htmlpurifier/library/HTMLPurifier/Injector/AutoParagraph.php
parentad92c6ac62903f3bb37f16048fedff44a2eb540d (diff)
update HTMLPurifier; enable embedded flash video in articles
Diffstat (limited to 'lib/htmlpurifier/library/HTMLPurifier/Injector/AutoParagraph.php')
-rw-r--r--[-rwxr-xr-x]lib/htmlpurifier/library/HTMLPurifier/Injector/AutoParagraph.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/htmlpurifier/library/HTMLPurifier/Injector/AutoParagraph.php b/lib/htmlpurifier/library/HTMLPurifier/Injector/AutoParagraph.php
index 8cc952549..afa760892 100755..100644
--- a/lib/htmlpurifier/library/HTMLPurifier/Injector/AutoParagraph.php
+++ b/lib/htmlpurifier/library/HTMLPurifier/Injector/AutoParagraph.php
@@ -34,16 +34,21 @@ class HTMLPurifier_Injector_AutoParagraph extends HTMLPurifier_Injector
// ----
// This is a degenerate case
} else {
- // State 1.2: PAR1
- // ----
+ if (!$token->is_whitespace || $this->_isInline($current)) {
+ // State 1.2: PAR1
+ // ----
- // State 1.3: PAR1\n\nPAR2
- // ------------
+ // State 1.3: PAR1\n\nPAR2
+ // ------------
- // State 1.4: <div>PAR1\n\nPAR2 (see State 2)
- // ------------
- $token = array($this->_pStart());
- $this->_splitText($text, $token);
+ // State 1.4: <div>PAR1\n\nPAR2 (see State 2)
+ // ------------
+ $token = array($this->_pStart());
+ $this->_splitText($text, $token);
+ } else {
+ // State 1.5: \n<hr />
+ // --
+ }
}
} else {
// State 2: <div>PAR1... (similar to 1.4)