GDScript code highlighting#2892
Conversation
|
Visually, I think this looks good. A few comments, some about undocumented conventions (sorry!):
Holler if any of this needs more explanation. With changes, I can do a more thorough review. |
|
I added a separate gdscript-prism.js file to inject the syntax highlighting. I'm not sure how to get syntax highlighting working in the activecode. It looks like it uses code mirror, and I think there is a gdscript module for code mirror. So, I'll need to look into that for a future version. There are now 2 examples in the sample book as well as the godot-shell folder that holds the godot wasm files. Sorry about the merge commits. In the future, I won't update the branch after making changes to it. I submitted a pull request for the rs changes, and I'll let you know when it goes through. |
|
I also had some trouble with indentation with a code in a program in a statement for an activity. (Maybe it's all the nesting.) |
|
The JavaScriptBridge filtering is to address the largest security concern with using a Godot WASM file. The filtering restricts JavaScript calls that aren't specifically postMessages that have a JSON dictionary as a payload, and a known origin. As long as eval isn't used on the JSON dictionary, this should restrict calls to actual GDScript instead of allowing arbitrary javascript code to be run in the WASM. |
Made necessary changes for GDScript 2.0 highlighting.
Documentation was updated to include runestone support, but runestone activecode isn't working yet. (Right now it's set to work with JOBE, but I'm leaning towards a client side solution more like sql.)
Prism has GDScript 1.0 highlighting, so I had to add some custom javascript to handle code with
@.Latex's
listingslibrary supports python, which is pretty close, but not a perfect match.