Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown could use a better comment syntax #58

Open
benhourigan opened this issue May 13, 2015 · 0 comments
Open

Markdown could use a better comment syntax #58

benhourigan opened this issue May 13, 2015 · 0 comments

Comments

@benhourigan
Copy link

Short version: Markdown could mark block and inline comments using the % character, rather than relying on HTML comments.

For example…

Block comment:

% This is a block comment. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pretium elementum eros, ac dignissim purus volutpat et. Integer eleifend.

Inline comment:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. %%Here is an inline comment.%% Pellentesque pretium elementum eros, ac dignissim purus volutpat et.


Explanation

Markdown could use a comment syntax that's more in line with the rest of the markup.

Most formatting in Markdown is created with just a single character at the beginning of a line (i.e. #, *, >) or a pair of characters (for *italic*, **bold**, etc.).

But the only way you can comment out text is by using HTML comments, which are comparatively much more difficult: <!-- Here is a comment --> There's a minimum of three characters on each side, at least two of which are different, and the start and end of the paired markers are different.

I use Markdown to collaborate with non-technical users on writing projects, and I've noticed that while these users get the hang of Markdown quickly, they almost always get comments wrong.

We already have CriticMarkup extending commenting, but it arguably suffers from the same problem: the markup is too complex for novice users to master quickly

What I'd propose is a single-character markup for comments that works for block and inline comments. The number one candidate, from my perspective, would be %, which is used to mark comments in LaTeX and also in the Markdown-inspired editor Ulysses.

It's possible that other characters might work better. Another candidate would be //, as used in JavaScript. Having to use /* */ would not be ideal as the beginning and end of the pair differ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant