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>
<div class="scratch-inline-images">
<object data="{% static 'scratch-blocks-a3b77ed3c3fa57e43c830e338dc39d292c7def676e0e8f7545972b7da20275da.svg' %}" type="image/svg+xml">
</object>
</div>
<div class="scratch-inline-images">
<object data="{% static 'scratch-blocks-cd6d9a0d464bb8f5eec1e6fc9a4e33378a64ebfce7c6198794ead614962f38e5.svg' %}" type="image/svg+xml">
</object>
</div>
<div class="scratch-inline-images">
<object data="{% static 'scratch-blocks-8e8a2129c3cecf32101248439961735fc1d45793fadc56e2575673f63d42b9fb.svg' %}" type="image/svg+xml">
</object>
</div>