InternationalScratchWiki / InternationalScratchWiki/mw-ScratchBlocks4
Is this extension useful?
- Dominant language
- PHP
- Stars
- 10
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
MediaWiki has a parser engine, which takes in wikitext and outputs HTML. scratchblocks.js is a JavaScript library which takes formatted text and outputs HTML which resembles Scratch blocks. Essentially, it is a parser written in JavaScript. But scratchblocks on the wiki has never used the MediaWiki parser to make Scratch blocks, instead, it parses \ into \
,then embeds the JavaScript which parses it from there. This means this extension is not doing anything the JS couldn't do directly, since \can simply be put into the page. In addition, this approach causes problems-- namely, scratchblocks cannot be used within the visual editor. Adding a new \ tag can't be done at all, and there's no way to (easily) render existing ones since in editing mode it doesn't use the parsed output and instead simply shows the input text-- although a pre element is used, it is not class="blocks", and trying to treat it as one can break other things.Ultimately, there are two solutions to this problem:
1) cease using scratchblocks.js and instead write MediaWiki code to parse scratchblocks into scratchblocks-like HTML, essentially rewriting all of scratchblocks.js to work on the MediaWiki backend. This would help, but is a lot of work and also reinventing the wheel. I think continuing to use the parser already maintained by its own community would help in keeping it up o date.
2) cease using this extension; instead, embed scratchblocks.js directly and use \in pages (or perhaps a template called Template:Scratchblocks to more easily faciliate this).Solution #2 is a good idea, in my opinion. It means not having to rely on an extension whose only purpose is to pretend wikitext is not wikitext and to load JavaScript (not parsing anything), not having one extra extension which doesn't do anything that can't be done without it, and also makes it possible to add scratchblocks in the Visual editor (and maybe even preview them as blocks too-- not tested yet).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.