Parsoid has a linter extension
<https://www.mediawiki.org/wiki/Help:Extension:Linter> which is well
suited for something like this and was effectively developed with
something like this in mind. It is currently enabled on *all* parses,
but in the future, depending on how expensives lints become, we may find
alternate ways of running this.
As it turns out, Parsoid's extension API exposes a lintHandler entry
point
<https://www.mediawiki.org/wiki/Parsoid/Extension_API#ExtensionTagHandler_abstract_class>
for extensions to run their lints. So, of course, you can only support
this in the context of Parsoid's parses. The other caveat is that we
haven't fully thought through all the details, but if you are
interested, this would be a good use case to explore this. But, see
Cite's ref-tag's implementation for this.
<https://github.com/wikimedia/parsoid/blob/20a4384b1f81366ccd72b1153c8a342f46a0318f/src/Ext/Cite/Ref.php#L59-L81>
This implementation effectively calls Parsoid's default handlers on the
wikitext encountered in the <ref> tag, but, extensions which might deal
with their own wikitext might do other processing here without calling
the default handler.
This is my recommended approach rather than mess with change streams,
diffs, etc.
Subbu.
On 7/1/21 7:16 AM, Physikerwelt wrote:
Dear all,
we have developed a tool that is (in some cases) capable of checking
if formulae in <math/>-tags in the context of a wikitext fragment are
likely to be correct or not. We would like to test the tool on the
recent changes. From
https://www.mediawiki.org/wiki/API:Recent_changes_stream
<https://www.mediawiki.org/wiki/API:Recent_changes_stream>
we can get the stream of recent changes. However, I did not find a way
to get the diff (either in HTML or Wikitext) to figure out how the
content was changed. The only option I see is to request the revision
text manually additionally. This would be a few unnecessary requests
since most of the changes do not change <math/>-tags. I assume that
others, i.e., ORES
https://www.mediawiki.org/wiki/ORES <https://www.mediawiki.org/wiki/ORES>,
compute the diffs anyhow and wonder if there is an easier way to get
the diffs from the recent changes stream without additional requests.
All the best
Physikerwelt (Moritz Schubotz)
_______________________________________________
Wikitech-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
_______________________________________________
Wikitech-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/