commonmark / cmark

CommonMark parsing and rendering library and program in C
Other
1.62k stars 542 forks source link

Support namespaces in tag names #341

Closed ioquatix closed 4 years ago

ioquatix commented 4 years ago

It can be useful to embed tags with namespaces and have them pass through correctly.

Some parsers already support this:

irb(main):002:0> Kramdown::Document.new("<foo:bar>\nbaz\n</foo:bar>").to_html
=> "<foo:bar>\nbaz\n</foo:bar>\n"

Tag names and attribute names should be allowed to contain :.

Further discussion:

ioquatix commented 4 years ago

Other parsers don't support it:

irb(main):005:0> CommonMarker.render_doc("<foo:bar>\nbaz\n</foo:bar>").to_html
=> "<p><a href=\"foo:bar\">foo:bar</a>\nbaz\n&lt;/foo:bar&gt;</p>\n"
movermeyer commented 4 years ago

Edit: Please ignore. I'm a dummy


Some parsers already support this

~It doesn't matter what Kramdown does, since it is a Markdown renderer, not a Commonmark renderer.~

~The whole point of Commonmark is that there is one spec. Not a collection of Markdown extensions that people implement in their parsers~

ioquatix commented 4 years ago

The point is to show that it's feasible/possible and that some implementations do it already. It's useful to have a point of reference when considering how we evolve the spec (or not).

movermeyer commented 4 years ago

@ioquatix I am soooo sorry. I'm in the wrong repo...

Sorry, sorry, sorry...

ioquatix commented 4 years ago

@movermeyer is there a better place to make issues regarding changes to the spec?

jgm commented 4 years ago

This is for cmark, the C implementation of the spec. To raise issues regarding changes to the spec, you should start at https://talk.commonmark.org. There is also a repo commonmark/commonmark-spec, but it is better to discuss on the forum first.

ioquatix commented 4 years ago

@jgm I made a topic for discussion and added a PR to the spec here: https://github.com/commonmark/commonmark-spec/pull/648