It would be better and fairer to legislate that GrubHub and others must be clear about where their pricing comes from rather than legislating what their prices should be.
They can still charge whatever they want for their fee. They just can't hide their fee in the list price of your sushi.
Legal: "Your pizza is $10. Our fee is $3, delivery is $5. Total bill $18." Restaurant gets $10.
Not legal: "Your pizza is $10 (but we quietly take $3 of that). Our fee is $3 (but we hid an extra $3 in the pizza!). Delivery is $5. Total bill $18." Restaurant gets $7.
Legal: "Your pizza is $7. Our fee is $6, delivery is $5. Total bill $18." Restaurant gets $7.
Legal: "Your pizza is $10. Our fee is $6, delivery is $5. Total bill $21." Restaurant gets $10.
Legal (but not great for business): "Your pizza is $10. Our fee is $600 because 'fuck you, we have VCs to pay', delivery is $5. Total bill $615." Restaurant gets $10.
Because customers who order through Grubhub/Doordash blame the restaurant for issues such as high prices and wrong orders instead of Grubhub/Doordash. So on one hand, the restaurant gets increased business but on the other they never interact with the customer directly and so their business' reputation depends on Grubhub/Doordash/etc to not fuck up, which is unlikely.