Plugin Directory

Changeset 3824904


Ignore:
Timestamp:
11/26/2026 01:01:01 AM (less than one hour ago)
Author:
npmyj
Message:

Tested up to 7.2; recommend <code> over <div> in usage docs

Location:
iyo-block-code-renderer-scratch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • iyo-block-code-renderer-scratch/tags/1.1.7/readme.txt

    r3698614 r3824904  
    33Tags: scratch, education, code, block, coderdojo
    44Requires at least: 5.8
    5 Tested up to: 7.1
     5Tested up to: 7.2
    66Requires PHP: 7.4
    77Stable tag: 1.1.7
    … …  
    27273. Add a `scratchblocks` class element to your content and write Scratch pseudocode inside it:
    2828
    29 `<div class="scratchblocks">
     29`<code class="scratchblocks">
    3030when green flag clicked
    3131say [Hello!]
    32 </div>`
     32</code>`
    3333
    3434Note: Manually escape `<` and `>` characters (e.g. `&lt;` and `&gt;`) inside the block.
     35
     36Note: Use `<code>` (or `<pre>`), not `<div>`. WordPress's `wptexturize` filter can rewrite plain
     37punctuation such as a hyphen surrounded by spaces (` - `) into a dash character before the page is
     38sent to the browser, and it only leaves the contents of `<pre>`, `<code>`, `<kbd>`, `<style>`,
     39`<script>`, and `<tt>` tags untouched. If the block is inside a `<div>`, an operator like `-` can
     40be silently corrupted, which makes scratchblocks render it as an unrecognized block (shown in red)
     41instead of the intended operator block.
    3542
    3643== Frequently Asked Questions ==
    … …  
    3946
    4047Currently English (`en`) and Japanese (`ja`) are enabled.
     48
     49= Why does an operator like `-` sometimes render in red instead of its normal color? =
     50
     51This usually means the character reaching the browser is not a plain ASCII hyphen. WordPress's
     52`wptexturize` filter can rewrite a hyphen surrounded by spaces into a dash character, and it only
     53skips this rewriting inside `<pre>`, `<code>`, `<kbd>`, `<style>`, `<script>`, and `<tt>` tags.
     54Write your Scratch pseudocode inside `<code class="scratchblocks">...</code>` (or
     55`<pre class="scratchblocks">...</pre>`) rather than a `<div>` to avoid this.
    4156
    4257= Where does the rendering happen? =
  • iyo-block-code-renderer-scratch/trunk/readme.txt

    r3698612 r3824904  
    33Tags: scratch, education, code, block, coderdojo
    44Requires at least: 5.8
    5 Tested up to: 7.1
     5Tested up to: 7.2
    66Requires PHP: 7.4
    77Stable tag: 1.1.7
    … …  
    27273. Add a `scratchblocks` class element to your content and write Scratch pseudocode inside it:
    2828
    29 `<div class="scratchblocks">
     29`<code class="scratchblocks">
    3030when green flag clicked
    3131say [Hello!]
    32 </div>`
     32</code>`
    3333
    3434Note: Manually escape `<` and `>` characters (e.g. `&lt;` and `&gt;`) inside the block.
     35
     36Note: Use `<code>` (or `<pre>`), not `<div>`. WordPress's `wptexturize` filter can rewrite plain
     37punctuation such as a hyphen surrounded by spaces (` - `) into a dash character before the page is
     38sent to the browser, and it only leaves the contents of `<pre>`, `<code>`, `<kbd>`, `<style>`,
     39`<script>`, and `<tt>` tags untouched. If the block is inside a `<div>`, an operator like `-` can
     40be silently corrupted, which makes scratchblocks render it as an unrecognized block (shown in red)
     41instead of the intended operator block.
    3542
    3643== Frequently Asked Questions ==
    … …  
    3946
    4047Currently English (`en`) and Japanese (`ja`) are enabled.
     48
     49= Why does an operator like `-` sometimes render in red instead of its normal color? =
     50
     51This usually means the character reaching the browser is not a plain ASCII hyphen. WordPress's
     52`wptexturize` filter can rewrite a hyphen surrounded by spaces into a dash character, and it only
     53skips this rewriting inside `<pre>`, `<code>`, `<kbd>`, `<style>`, `<script>`, and `<tt>` tags.
     54Write your Scratch pseudocode inside `<code class="scratchblocks">...</code>` (or
     55`<pre class="scratchblocks">...</pre>`) rather than a `<div>` to avoid this.
    4156
    4257= Where does the rendering happen? =
Note: See TracChangeset for help on using the changeset viewer.