EBernhardson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/95563
Change subject: Hackish method of respecting parsoid base href
......................................................................
Hackish method of respecting parsoid base href
Saves the base href returned by parsoid along with the content. If we were
displaying content from multiple sources on the same page this wouldn't work,
so its only a temporary fix.
Change-Id: Id06ebff051e7cc294c75aec136f2820e77c09fca
---
M includes/ParsoidUtils.php
1 file changed, 8 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/63/95563/1
diff --git a/includes/ParsoidUtils.php b/includes/ParsoidUtils.php
index 82e91c5..ddf786f 100644
--- a/includes/ParsoidUtils.php
+++ b/includes/ParsoidUtils.php
@@ -70,7 +70,14 @@
$dom->loadHTML( $response );
$body = $dom->getElementsByTagName( 'body' )->item(0);
- $response = '';
+ // Save the <base href="..."> tag if it exists.
+ // @todo At some point we will need to actually do
something with this, but
+ // for now because we only render posts from the same
source page together we
+ // can currently just include the tag anywhere in the
output html. To display
+ // posts from multiple sources in one page this will
have to change.
+ $baseHref = $dom->getElementsByTagName( 'base'
)->item(0);
+
+ $response = $baseHref->ownerDocument->saveXML(
$baseHref );
foreach( $body->childNodes as $child ) {
$response .= $child->ownerDocument->saveXML(
$child );
}
--
To view, visit https://gerrit.wikimedia.org/r/95563
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id06ebff051e7cc294c75aec136f2820e77c09fca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits