Page MenuHomePhabricator

Wikimedia OCR doesn't work when syntax highlighting is on
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Open any page on the Page: namespace
  • Turn on the syntax highlighter (provided by default by Extension:CodeMirror)
  • Click the "Transcribe text" button

What happens?:
*After a few seconds, nothing

What should have happened instead?:
*Something

Older, gadget-based tools work fine.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
MusikAnimal renamed this task from WikisourceOCR doesn't work when syntax highlighting is on to Wikimedia OCR doesn't work when syntax highlighting is on.Aug 18 2022, 7:00 PM
MusikAnimal added subscribers: Soda, Bebiezaza, Shells-shells.

Change 824580 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/Wikisource@master] OCR: Use textSelection API to change page contents

https://gerrit.wikimedia.org/r/824580

Samwilson changed the point value for this task from 2 to 1.
Samwilson subscribed.

One way to fix this would be to have Wikisource OCR depend on the textselection API instead of directly querying the value of the textarea.

Good point! I'm not sure why we weren't doing that to start with. I've made a patch.

Change 824580 merged by jenkins-bot:

[mediawiki/extensions/Wikisource@master] OCR: Use textSelection API to change page contents

https://gerrit.wikimedia.org/r/824580

dom_walden subscribed.

Transcription appears to work with CodeMirror enabled. The wikitext is replaced with the text returned by the transcription tool.

Undo works as well with CodeMirror enabled. I checked that it restored the correct text by clicking "Show changes" and seeing nothing had changed.

I also retested transcription and undoing without CodeMirror enabled, and switching between the two during the course of an editing session does not appear to affect the behaviour of transcription or undoing.

Test environment: https://en.wikisource.beta.wmflabs.org Wikisource – (ba90d0d) 01:35, 19 August 2022.
Browser: Firefox 91.

NRodriguez subscribed.

tested and 🫡✅