문제

In a Mako template, ## is intended to comment out anything that is not to appear in the output.

But in Markdown, ## means sub-heading, ### means sub-sub-heading, etc.

Now applying a Markdown filter in Mako, isn't it obvious that there is a conflict?

도움이 되었습니까?

해결책

Only in the Mako template itself is ## a comment. You can still use variables (e.g., ${x}) that are strings that contain hash characters without worrying they'll be interpreted as comments.

According to Mako Syntax:

Above, the string representation of x is applied to the template’s output stream.

The variable is sent directly to the output.

It's the same concept of having hash characters in a Python string. For example:

s = "#This would be a Python comment"
print(s) # returns "#This would be a Python comment"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top