💡📝H. G. Muller wrote on Sat, Feb 10, 2024 09:51 AM UTC:
Umm, I see now what the problem is when you try to paste a Diagram specification directly from the Page Source into the PTA. It contains a lot of HTML tags that do not produce any visible output, which I could make show up by first replacing the < character by the escape sequence for it. I then got this as the pasted definition against which the PTA complained:
I suppose the best counter measure would be to scan every line for the occurence of the substring 'span>', and then retain only everything that is beyond the last occurrence of that. I do that now, and it appears to solve the problem: I can directly copy-paste Diagram definitions from a Page Source. I also improved the error reporting: when the Diagram script gets a specification it does not understand, it will now first replace all < caharacters by their HTML escape sequence, so that the browser will no longer recognize any HTML tags in it, and display these as encountered in the error message.
[Edit] While at it, I also expanded the capabilities of the Move-Definition Aid to understand leaps to the 4th ring. (As I already did yesterday in the Checkmating Applets.) Originally the 4th ring was only there for seeing when you had defined a rider, or for cutting the range of a slider. Perhaps I should increase the size of the panel, so that you could also see or enter 5th-ring moves.
Umm, I see now what the problem is when you try to paste a Diagram specification directly from the Page Source into the PTA. It contains a lot of HTML tags that do not produce any visible output, which I could make show up by first replacing the < character by the escape sequence for it. I then got this as the pasted definition against which the PTA complained:
I suppose the best counter measure would be to scan every line for the occurence of the substring 'span>', and then retain only everything that is beyond the last occurrence of that. I do that now, and it appears to solve the problem: I can directly copy-paste Diagram definitions from a Page Source. I also improved the error reporting: when the Diagram script gets a specification it does not understand, it will now first replace all < caharacters by their HTML escape sequence, so that the browser will no longer recognize any HTML tags in it, and display these as encountered in the error message.
[Edit] While at it, I also expanded the capabilities of the Move-Definition Aid to understand leaps to the 4th ring. (As I already did yesterday in the Checkmating Applets.) Originally the 4th ring was only there for seeing when you had defined a rider, or for cutting the range of a slider. Perhaps I should increase the size of the panel, so that you could also see or enter 5th-ring moves.