Go to file
Subramanya Sastry a1c5130414 Add ParserOutputPostCacheTransformHook handler for Parsoid HTML
* This patch enables DT to work with Parsoid HTML without changing
  the functionality for legacy HTML.

* The code comments document some of the decisions being made here.
  Some of these decisions are temporary and need better solutions
  but this patch will let us run visual diff tests and expose any
  other latent bugs.

TODO
----
* We need to add new tests to verify CommentFormatter expectations
  for Parsoid HTML. I'll tackle this in a followup patch.

Known issues:
-------------
* Performance: Since the getText() transformed output in ParserOutput
  is not cached, if DiscussionTools is to switch over to Parsoid HTML,
  we have to add some form of caching of the transformed output because
  transformHtml can take a couple seconds in the p99 case which is too
  long to render uncached!

* Longer-term: Since this hook is called when getText() is
  called, all calls to getText() will now invoke this handler
  (which will return but still has to do a bunch of checks to
  determine this won't apply). Presumably, transformHtml() is
  idempotent because when some other code (other extensions, for ex)
  calls getText(), we will run the transfromHtml() on previously
  transformed content.

  My understanding is that getText() is going the way of the dodo
  and that getText() callers will have to explicit call the output
  transform pipeline code (and presumably this issue of repeatedly
  calling the same transforms on previously transformed content will
  be addressed there).

* Some CSS doesn't apply to Parsoid HTML because intervening <section>
  tags interfere with existing query selectors -- will be addressed
  separately.

Bug: T341010
Change-Id: I9846193656cdc658f5237df0a133d9d4dcc20d00
2023-11-09 18:37:56 +00:00
.phan ThreadItemStore: Add details to row insertion exceptions 2023-09-14 19:05:04 +00:00
i18n Localisation updates from https://translatewiki.net. 2023-11-09 10:40:35 +01:00
images Compress emptystate.svg with svgo 2021-10-04 12:56:20 +01:00
includes Add ParserOutputPostCacheTransformHook handler for Parsoid HTML 2023-11-09 18:37:56 +00:00
maintenance persistRevisionThreadItems: Use SQL expression builder 2023-10-21 23:22:34 +02:00
modules Use top alignment for buttons on mobile talk pages 2023-11-03 18:58:19 +00:00
sql Store permalink data, implement Special:FindComment/GoToComment 2022-08-11 01:19:47 +02:00
tests Merge "Replace preg_replace_callback with strtr in CommentParser" 2023-10-31 13:35:19 +00:00
.eslintignore Add button to reveal lede section on mobile 2022-11-10 22:10:04 +00:00
.eslintrc.json Don't enforce alphabetical order in i18n files 2022-08-12 13:29:39 +03:00
.gitignore Remove extra blank line from .gitignore file 2020-08-31 15:24:56 +01:00
.gitreview .gitreview: Remove defaultrebase/defaultbranch 2023-09-09 21:37:34 +00:00
.phpcs.xml Use type hints for properties, remove PHPCS overrides 2023-10-19 19:31:02 +00:00
.stylelintrc.json Move "Return to comment" below sticky header when present 2022-09-25 13:28:12 +01:00
CODE_OF_CONDUCT.md build: Updating npm dependencies 2020-01-09 06:43:15 +00:00
composer.json build: Updating mediawiki/mediawiki-phan-config to 0.12.1 2023-04-29 02:29:39 +00:00
COPYING Add required files for an extension 2019-10-10 19:42:56 +01:00
DiscussionTools.alias.php Translate DiscussionTools alias into Bengali (bn) 2023-08-19 00:31:46 +00:00
DiscussionTools.magic.php Translate magic words into Bengali (bn) 2023-08-19 00:06:13 +00:00
extension.json Add ParserOutputPostCacheTransformHook handler for Parsoid HTML 2023-11-09 18:37:56 +00:00
Gruntfile.js eslint: Lint root folder with server rules 2021-10-07 17:37:52 +01:00
package-lock.json build: Update devDependencies 2023-05-24 18:55:11 +01:00
package.json build: Update devDependencies 2023-05-24 18:55:11 +01:00