Subramanya Sastry has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/50018


Change subject: Emit base href in /_rt/ output of the server in api/
......................................................................

Emit base href in /_rt/ output of the server in api/

* /_rt/* urls had broken image display because of missing
  base href in the document header.

* Fixed and verified.

Change-Id: I72140a4b4f69f9982fb457768f7d904a2145735e
---
M js/api/ParserService.js
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/18/50018/1

diff --git a/js/api/ParserService.js b/js/api/ParserService.js
index 434fa26..85c6d57 100644
--- a/js/api/ParserService.js
+++ b/js/api/ParserService.js
@@ -199,9 +199,13 @@
                        res.send( out, 500 );
                        return;
                }
-               res.write('<html><head><script type="text/javascript" 
src="/jquery.js"></script><script type="text/javascript" 
src="/scrolling.js"></script><style>ins { background: #ff9191; text-decoration: 
none; } del { background: #99ff7e; text-decoration: none }; 
</style></head><body>');
+               res.write('<html><head>')
+               res.write('<script type="text/javascript" 
src="/jquery.js"></script><script type="text/javascript" 
src="/scrolling.js"></script><style>ins { background: #ff9191; text-decoration: 
none; } del { background: #99ff7e; text-decoration: none }; </style>');
+               // Emit base href so all relative urls resolve properly
+               
res.write(Util.serializeNode(document.firstChild.firstChild.lastChild));
+               res.write('</head><body>');
                res.write( '<h2>Wikitext parsed to HTML DOM</h2><hr>\n' );
-               res.write(document.body.innerHTML + '\n<hr>');
+               res.write(Util.serializeNode(document.body) + '\n<hr>');
                res.write( '<h2>HTML DOM converted back to Wikitext</h2><hr>\n' 
);
                res.write('<pre>' + htmlSpecialChars( out ) + '</pre><hr>\n');
                res.write( '<h2>Diff between original Wikitext (green) and 
round-tripped wikitext (red)</h2><p>(use shift+alt+n and shift+alt+p to 
navigate forward and backward)<hr>\n' );

-- 
To view, visit https://gerrit.wikimedia.org/r/50018
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72140a4b4f69f9982fb457768f7d904a2145735e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <ssas...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to