ox icon indicating copy to clipboard operation
ox copied to clipboard

Spaces in comments

Open kraft001 opened this issue 11 months ago • 4 comments

Comments should not have spaces between their open/close tokens and the content (link) The fix is quite simple - just remove spaces from here

kraft001 avatar May 22 '25 18:05 kraft001

Can you explain why you this it is contrary to the specification to include space padding? I know they are not required but even the example in the specification is space padded.

ohler55 avatar May 22 '25 20:05 ohler55

The specification doesn't include a space in the open <!-- or close --> tokens, the example is ambiguous because it may describe a comment with the space-padded content. The current behavior conflicts with 3 other xml libraries (nokogiri, oga, rexml). I'm trying to merge them all (including ox) into this gem, and even slightest deviations from the specification cause issues.

kraft001 avatar May 22 '25 20:05 kraft001

I wonder if it is worth adding an option. Maybe not as it is only a comment and not content. I'll make a branch with the change tonight and do a little research myself before merging.

ohler55 avatar May 22 '25 21:05 ohler55

Released v2.14.23 with the fix.

ohler55 avatar May 28 '25 01:05 ohler55