Go to file
Timo Tijhof 61874ca30e ScribuntoContentHandler: Refactor fillParserOutput()
The ParserOutput object used here starts life as the ParserOutput for
parsing the docpage (wrapped via an interface message). In order to
remove use of the Title::getPageViewLanguage method there, we need to
re-arrange some logic such that we parse the doc page first, and see
what language it was rendered in, instead of currently where
Title::getPageViewLanguage tries to "guess" what Parser and
LanguageConverter will do.

As prep for that stop reading/writing the HTML text of this
ParserOutput object in favour of being more like the Parser itself,
which accumulates metadata in ParserOutput and calls setText only
once at the end.

* Refactor highlight() to return standalone HTML instead.
* Refactor validation error to append to $html instead.

Other improvements while at it:

* Document how stuff works today.
* Clarify variable names.
* Separate concerns better by moving responsibility of `<pre>`
  fallback to highlight(), and limiting knowledge of
  ScribuntoEngineBase to the caller.

Bug: T350806
Change-Id: I9fe6d93727f29c284ea21db6edd6a2b1663e8e06
2023-12-01 22:25:51 +00:00
.phan Use HookHandlers for CodeEditor hook 2023-08-15 13:50:13 +02:00
i18n Localisation updates from https://translatewiki.net. 2023-11-27 08:33:11 +01:00
includes ScribuntoContentHandler: Refactor fillParserOutput() 2023-12-01 22:25:51 +00:00
modules Assign UUIDs to Scribunto errors independent of page parse order 2023-10-13 15:23:22 +00:00
tests Ensure that Scribunto exceptions have a page context set 2023-11-27 14:08:12 +00:00
.eslintrc.json build: Updating mediawiki/mediawiki-phan-config to 0.10.4 2020-11-20 17:01:25 +00:00
.gitignore build: Upgrade eslint-config-wikimedia 0.12.0, drop grunt-jsonlint 2019-05-07 10:40:41 -07:00
.gitreview Whoops, track not trace 2016-10-24 17:03:31 -07:00
.phpcs.xml tests: Replace assertEmpty with assertCount 2022-11-25 10:26:34 +00:00
.stylelintrc.json Use json extension for .stylelintrc 2017-08-19 10:27:54 +02:00
CODE_OF_CONDUCT.md build: Updating mediawiki/mediawiki-codesniffer to 22.0.0 2018-09-03 21:33:35 +00:00
composer.json build: Updating dependencies 2023-04-29 10:08:46 +00:00
COPYING Add strict.lua to replace "Module:No globals" 2022-10-13 04:39:21 +00:00
extension.json build: Update MediaWiki requirement to 1.41 2023-08-19 14:05:01 +08:00
Gruntfile.js build: Updating dependencies 2021-01-30 10:41:13 +00:00
package-lock.json build: Updating npm dependencies 2023-06-02 02:13:44 +00:00
package.json build: Updating npm dependencies 2023-06-02 02:13:44 +00:00
Scribunto.constants.php Remove PHP entry point 2019-06-21 00:02:08 +00:00
Scribunto.magic.php Add namespace and magic word translations for mnw and my 2019-10-18 20:03:05 +00:00
Scribunto.namespaces.php Translate Scribunto namespaces into Uzbek (uz) 2023-05-24 22:19:24 +00:00