in Marlin, I enabled GCODE_MOTION_MODES to print gcode generated by Laserweb4, using modal Group 1 commands.
Generated gcode looks like this:
G1 X13.65 Y18.85 S0.0000 X13.70 S11.4000 X14.50 S15.9000 X14.55 S10.2000
and is accepted by Marlin after this change.
Unfortunately, it seems to confuse Octoprint, it does not wait for "ok" after each line but tries sending the whole gcode file at once.