jgm / djot

A light markup language
https://djot.net
MIT License
1.71k stars 43 forks source link

Test escapes in the middle of a quoted attribute. #166

Closed ratmice closed 1 year ago

ratmice commented 1 year ago

I noticed there isn't a test that checks escaping of attributes, when it isn't the first character of a string. Though I am somewhat curious if '\{' is really needed anymore since https://github.com/jgm/djot/commit/a6cc50f3a2568028efdef97a0fc7b85a386226aa

jgm commented 1 year ago

Thanks, yes, we should have a test for escapes. You don't have to escape { in this context, but you should be able to escape anything.

jgm commented 1 year ago

Actually, it would be better to change this to test \" inside quotes; that's what really needs to be escaped, and it would be good to test that the escape works for it.

ratmice commented 1 year ago

I changed the existing one at the beginning of the key to also escape quotes too then.

jgm commented 1 year ago

Hm, I don't see an escaped " there?

ratmice commented 1 year ago

Sorry, helps if I commit it.