Proposal: Standardize a native syntax for Markdown comments
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- markdown
- Ambito
- documentation
Direzione di ricerca
Start by reading the CommonMark specification and comparing the comment conventions named in the issue: HTML comments, link-reference hacks, Obsidian’s %% syntax, and language-style delimiters. The issue proposes standardizing a syntax but leaves the choice open, so done would require settling on a syntax and specifying how it is omitted from the AST or HTML output.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The core spirit and mission of CommonMark is to standardize Markdown to ensure interoperability across different platforms. However, the lack of a standardized syntax for comments (text that is ignored by renderers and not outputted to HTML) remains a major omission.
Because the spec has left this out, a highly fragmented ecosystem has emerged. There is a deep disconnect between markdown editors and markdown viewers:
-
The HTML Comment Hack (): Many users rely on this, but it is technically passed through to the HTML output. This leaks internal notes to the production source code, which is highly undesirable for security, privacy, and file size reasons.
-
The Link Reference Hack ([^comment]: or [//]: #): Various editors and parsers have adopted different link-label hacks to trick compilers into ignoring text.
-
Custom Syntaxes (%%comment%%): Apps like Obsidian use their own internal formatting, which completely breaks portability when the file is read by standard CommonMark parsers like GitHub or Jekyll.
This creates "disconnected camps" where a document containing comments looks perfect in a specific editor but leaks or breaks entirely when published to a standard viewer.
I would like to propose a native, standardized syntax for comments within the CommonMark specification.
A syntax that explicitly instructs the compiler to omit the wrapped text from the final abstract syntax tree (AST) or HTML output entirely.
Possible syntax directions already popular in the community include:
- %% Comment here %% (Used by Obsidian)
- [//]: # (Comment here) (A strictly regulated version of the link hack)
- // and /* */ already popular with a few languages
- A dedicated syntax like [# Comment here #] or similar blocks.
Continuing to rely on the <!-- HTML comment --> approach, which fails the requirement of keeping draft notes hidden from the final production source code, or accepting that Markdown files will continue to lose portability between different vendor apps.
Standardizing comments aligns perfectly with CommonMark’s goal. It resolves a massive point of friction for technical writers, content creators, and developers who need to leave notes, TODOs, or metadata in their files without leaking them to the end-user.
- Lingua principale
- Python
- Stelle
- 5.2k
- Fork
- 360
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di commonmark/commonmark-spec
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
commonmark/commonmark-spec#843 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
commonmark/commonmark-spec#838 · 2 commenti ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
commonmark/commonmark-spec#728 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
commonmark/commonmark-spec#842 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
commonmark/commonmark-spec#840 · 3 commenti ·
Tutte le issue di commonmark/commonmark-spec
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pgvector/pgvector-python#169 ·
-
ChaosEngine: backup-remote doctor row passes while consumer mode hides bot memory from gitForse già presa @MohabMohie l’ha presa oggi. Apertaagentic
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
ShaftHQ/SHAFT_ENGINE#7263 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 87/100
huggingface/smolagents#3045 ·
I maintainer di solito rispondono entro 1 giorno