Fix info text issue due to wca option.#49
Conversation
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.
|
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: SiGN: WCA: |
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.
|
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. |
|
Looks good to me so far, thank you for the fix. Let me do some more testing before merging. |
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