Scratch CompatibilityΒΆ
Processor name: scratch-compatibility
The scratch-compatibility
processor is a pre-processor that is enabled by the Scratch processor when the codehilite
and fenced_code
extensions are enabled.
When both codehilite
and fenced_code
extensions are enabled the fenced_code
extension modifies the fenced code-blocks by using methods from the codehilite
extension before stashing them to be place in later in the document. The scratch-compatibility
processor is therefore needed to stash the fenced code-blocks before fenced_code
so that they can be processed properly by the Scratch processor later.
Note
We consider the codehilite
and fenced_code
extensions a bad way of writing extensions as the output of one dramatically changes depending on if the other is active.
We believe that an extension like these should produce predictable output and handle compatibility through inputs.
For example if the following Markdown document is processed using both the codehilite
and fenced_code
extensions
Scratch is great for kids you can create simple code like:
```scratch
when flag clicked
say [Hi]
```
```scratch
when flag clicked
say [Hi]
move (foo) steps
turn ccw (9) degrees
```
```scratch
when flag clicked
clear
forever
pen down
if <<mouse down?> and <touching [mouse-pointer v]?>> then
switch costume to [button v]
else
add (x position) to [list v]
end
move (foo) steps
turn ccw (9) degrees
```
Verto will produce the following output (which is the same as the scratch
processor would expect):
<p>Scratch is great for kids you can create simple code like:</p>
<pre class="scratch-blocks"><code>when flag clicked
say [Hi]</code></pre>
<pre class="scratch-blocks"><code>when flag clicked
say [Hi]
move (foo) steps
turn ccw (9) degrees</code></pre>
<pre class="scratch-blocks"><code>when flag clicked
clear
forever
pen down
if <<mouse down?> and <touching [mouse-pointer v]?>> then
switch costume to [button v]
else
add (x position) to [list v]
end
move (foo) steps
turn ccw (9) degrees</code></pre>