logological / gpp

GPP, a generic preprocessor
https://logological.org/gpp
GNU Lesser General Public License v3.0
197 stars 31 forks source link

HTML and XHTML modes should use comments #50

Open flaviotordini opened 4 years ago

flaviotordini commented 4 years ago

I just discovered gpp and I love it. I am mostly surprised that HTML and XHTML modes do not use comments in their syntax. I think the main point of a preprocessor is allowing removal of some code based on some condition without making the document invalid. HTML mode should look like:

<!-- #ifdef MYDEFINE -->
<p>optional paragraph</p>
<!-- #endif -->

This preserves document validity and well-formedness. Allows for reformatting, rendering, etc.

I understand changing the modes would break compatibility. What about adding a new mode?