MediaWiki REL1_39
HTMLTransformFactory.php
Go to the documentation of this file.
1<?php
2
4
7use Wikimedia\Parsoid\Parsoid;
8
13
15 private $parsoid;
16
18 private $parsoidSettings;
19
21 private $configFactory;
22
28 public function __construct(
29 Parsoid $parsoid,
30 array $parsoidSettings,
31 PageConfigFactory $configFactory
32 ) {
33 $this->parsoid = $parsoid;
34 $this->parsoidSettings = $parsoidSettings;
35 $this->configFactory = $configFactory;
36 }
37
47 public function getHTMLTransform( string $modifiedHTML, PageIdentity $page ) {
48 // XXX: do we need to be able to override anything else in the PageConfig?
49 $pageConfig = $this->configFactory->create(
50 $page,
51 null,
52 null,
53 null,
54 null,
55 $this->parsoidSettings
56 );
57
58 return new HTMLTransform(
59 $modifiedHTML,
60 $pageConfig,
61 $this->parsoid,
62 $this->parsoidSettings
63 );
64 }
65
66}
Helper class used by MediaWiki to create Parsoid PageConfig objects.
__construct(Parsoid $parsoid, array $parsoidSettings, PageConfigFactory $configFactory)
getHTMLTransform(string $modifiedHTML, PageIdentity $page)
Get the HTML transform object for a given page and specified modified HTML.
Interface for objects (potentially) representing an editable wiki page.
Copyright (C) 2011-2022 Wikimedia Foundation and others.