fletcher / MultiMarkdown-4

This project is now deprecated. Please use MultiMarkdown-6 instead!
https://github.com/fletcher/MultiMarkdown-5
Other
307 stars 59 forks source link

Removing comments #118

Closed briatte closed 9 years ago

briatte commented 9 years ago

Hi,

I understand that the current behaviour of HTML comments is:

You can use HTML comments to include additional text that will be included in the exported file without being changed.

Now, is there any, any way to just ignore HTML comments? I have MMD files that look like this:

This is paragraph one.

<!-- TODO:
- revise sentence one
- revise sentence two -->

This is paragraph two.

It would be very helpful if I could completely ignore these comments. I use them as lot, and suspect that I am not the only one.

mn4367 commented 9 years ago

You mean that the XML comment should not appear at all in the generated HTML? No, that's not possible and I don't think that it ever will be since this type of comment is also used to embed raw LaTeX code (which is too helpful to be changed).

However, you could use CriticMarkup instead:

This is paragraph one.

{>> TODO:
- revise sentence one
- revise sentence two <<}

This is paragraph two.

If you then use multimarkdown -a or multimarkdown -r or multimakdown -a -r all CriticMarkup comments are simply ignored completely.

fletcher commented 9 years ago

The CriticMarkup answer is the "correct" one -- HTML comments are used for other purposes in MultiMarkdown as noted.

That said, you could create your own copy of MMD that ignores HTML comments altogether.

briatte commented 9 years ago

@mn4367 @fletcher Thank you for your replies. I've modified the MMD TextMate plugin to run multimarkdown -at latex instead of multimarkdown -t latex, which does the trick.

Just out of curiosity, what should I change to ignore HTML comments altogether? I guess it has to do with this block of code, but cannot get to it exactly.