Skip to content

Fix info text issue due to wca option.#49

Open
mfo13 wants to merge 2 commits intocubing:gh-pagesfrom
mfo13:fix-infotext-issue
Open

Fix info text issue due to wca option.#49
mfo13 wants to merge 2 commits intocubing:gh-pagesfrom
mfo13:fix-infotext-issue

Conversation

@mfo13
Copy link
Copy Markdown
Collaborator

@mfo13 mfo13 commented Apr 28, 2026

Fix info text issue due to wca option. The functions wca_to_sign (animcube3 to 7) and convertNotation4 (animcube4) now filter out info text in between braces {} before doing the conversion. The fix is not unbreakable; for example, you cannot nest braces, but this would break the script even before the fix.

To see the original issue try: AnimCubeN("move={Cube made easy and simple: Dw Fw} Dw Fw&wca=1") where N=3, 4, 5, 6, 7

Fix info text issue due to wca option. The functions wca_to_sign (animcube3 to 7) and convertNotation4 (animcube4) now filter out info text in between braces {} before doing the convertion. The fix is not umbreakeble, for example, you can not nest braces, but this would break the script even before the fix.
@mfo13 mfo13 requested a review from bcube2 April 29, 2026 02:56
@bcube2
Copy link
Copy Markdown
Collaborator

bcube2 commented Apr 29, 2026

Nice catch, thank you for reporting (I know I would never spot this).

Mixing up different notations can get very ugly very fast so I was testing only the documented possibilities (as I am sure you know, there are some undocumented moves in the animcubejs.html file for the wca parameter which are possible using different notations). Below are my results:

ACJS:
2x2x2: move={R Rc Ra}R Rc Ra&movetext=1
3x3x3: move={R Rm Rc Rs Ra Rt}R Rm Rc Rs Ra Rt&movetext=1
4x4x4: move={R Rm Rc Rs Ra Rt Rw}R Rm Rc Rs Ra Rt Rw&movetext=1
5x5x5: move={R Rm Rc Rs Ra Rt Rn}R Rm Rc Rs Ra Rt Rn&movetext=1
6x6x6: move={R Rm Rc Rs Ra Rt Rn Ru}R Rm Rc Rs Ra Rt Rn Ru&movetext=1
7x7x7: move={R Rm Rc Rs Ra Rt Rn Ru Ro}R Rm Rc Rs Ra Rt Rn Ru Ro&movetext=1
2x2x2-7x7x7: move={x y z}x y z&yz=1&movetext=5 (can´t use movetext=1 because of the c modifier, nor movetext=[2-4] because those are not supported in 4x4x4-7x7x7 cubes (plus they have their own style of displying as described in the movetext parameter section))

SiGN:
2x2x2: move={R Ra y}R Ra y&sign=1
3x3x3: move={R Ra r M Rs y}R Ra r M Rs y&sign=1
4x4x4: move={R Ra Rs 2R r m y}R Ra Rs 2R r m y&sign=1 - text comment not displayed properly
5x5x5: move={R r M Ra Rs 2R y}R r M Ra Rs 2R y&sign=1 - text comment not displayed properly
6x6x6: move={R Ra 2R 3R r 3r Rs y}R Ra 2R 3R r 3r Rs y&sign=1 - text comment not displayed properly
7x7x7: move={R Ra 2R 3R r 3r Rs M y}R Ra 2R 3R r 3r Rs M y&sign=1 - text comment not displayed properly

WCA:
2x2x2: move={R y}R y&wca=1
3x3x3: move={R Rw y}R Rw y&wca=1
4x4x4: move={R Rw y}R Rw y&wca=1
5x5x5: move={R Rw y}R Rw y&wca=1
6x6x6: move={R Rw 3Rw y}R Rw 3Rw y&wca=1 - text comment not displayed properly
7x7x7: move={R Rw 3Rw y}R Rw 3Rw y&wca=1 - text comment not displayed properly

Avoid replacing face tokens inside info boxes delimited by { ... } when using the function replaceMove() as already done for functions wca_to_sign() and convertNotation4(). Replace the direct s.replace(r, ...) with a chunked replacement that splits the string using /\{[^}]*\}|[^{}]+/g, skips segments starting with '{', and applies the face replacement only to non-braced segments. Applied to AnimCube4.js, AnimCube5.js, AnimCube6.js and AnimCube7.js to prevent unintended edits inside info boxes.
@mfo13
Copy link
Copy Markdown
Collaborator Author

mfo13 commented Apr 29, 2026

Dear bcube2, I was afraid that the replaceMove() function was suffering from the same issue and you was able to detect it. Thank you! I've made the same fixing as the ohter functions, try it now.

@bcube2
Copy link
Copy Markdown
Collaborator

bcube2 commented Apr 29, 2026

Looks good to me so far, thank you for the fix.

Let me do some more testing before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants