isaacs / sax-js

A sax style parser for JS
Other
1.09k stars 325 forks source link

Add an emitEmpty option. #231

Open lddubeau opened 6 years ago

lddubeau commented 6 years ago

The option emitEmpty cause sax to emit cdata and comment events even if the respective constructs were empty in the XML.

Prior to this commit, sax does not emit cdata or comment events if the respective constructs are empty in the XML. Some projects need to know that a CDATA section or a comment was present in the XML even though they were empty.

The default is false so this changes behavior only for those who explicitly use it.