GWicke has submitted this change and it was merged. Change subject: Get PHP parser to parse extension content for us. ......................................................................
Get PHP parser to parse extension content for us. * Introduced InternalTk -- very minimal right now and is only used to wrap extension content. Additional functionality can be introduced based on other use cases. * Since we are not going to reimplement every PHP extension in JS, we just cheat and get the PHP parser to process extension content for us. * This just calls the PHP api, tokenizes the HTML string, strips wrapper p-tag and trailing white-space/comments, wraps content in an InternalTk to pass it through later handlers without modification. The p-wrapper unwraps the internal tokens into the final expanded token stream so p-wrapping is accurate. The sanitizer pass through an InternalTk untouched. * Added PHPParseRequest as another API class to act as the bridge beween Parsoid and the PHP API. * Reused template handler wrapping functionality to wrap the parsed extension tokens. * If php-api is disabled, this renders extension as plain text wrapped in a span with a mw:Object/Extension/<name> typeof attribute. * Tested on en:Angle sum law Change-Id: I8aeb7f22d58bb9c4e845c3ef5b9e67a10df1d1da --- M js/lib/ext.ExtensionContentCollector.js M js/lib/ext.core.ParagraphWrapper.js M js/lib/ext.core.Sanitizer.js M js/lib/ext.core.TemplateHandler.js M js/lib/mediawiki.ApiRequest.js M js/lib/mediawiki.TokenTransformManager.js M js/lib/mediawiki.parser.defines.js 7 files changed, 211 insertions(+), 43 deletions(-) Approvals: GWicke: Verified; Looks good to me, approved jenkins-bot: Looks good to me, but someone else must approve -- To view, visit https://gerrit.wikimedia.org/r/38807 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8aeb7f22d58bb9c4e845c3ef5b9e67a10df1d1da Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Parsoid Gerrit-Branch: master Gerrit-Owner: Subramanya Sastry <[email protected]> Gerrit-Reviewer: GWicke <[email protected]> Gerrit-Reviewer: Subramanya Sastry <[email protected]> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
