Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add snippets for raw HTML #176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add snippets for raw HTML #176

wants to merge 1 commit into from

Conversation

hediyi
Copy link
Contributor

@hediyi hediyi commented Nov 5, 2016

No description provided.

@hediyi
Copy link
Contributor Author

hediyi commented Nov 6, 2016

Take the sanitation whitelist,

h1 h2 h3 h4 h5 h6 h7 h8 br b i strong em a pre code img tt
div ins del sup sub p ol ul table thead tbody tfoot blockquote
dl dt dd kbd q samp var hr ruby rt rp li tr td th s strike summary details

minus the non-standard elements,

h7 h8 tt strike

minus the elements that are covered by the GFM syntax,

h1 h2 h3 h4 h5 h6 br strong em a code img
del p ol ul table thead tbody tfoot blockquote
hr li tr td th

we get

b i pre
div ins sup sub
dl dt dd kbd q samp var ruby rt rp s summary details
  • The bold syntax generates strong
  • The italic syntax generates em
  • The strikethrough syntax generates del
  • The code block syntax generates <pre><code></code></pre>, so technically pre is not covered

@hediyi
Copy link
Contributor Author

hediyi commented Nov 6, 2016

In Atom, language-gfm is the grammar package for all .md, .markdown files by default. The thing is those files are not necessarily used on Github, so maybe we shouldn't confine the snippet list to only elements in the whitelist? Esp. when some frequently used text-level elements, e.g., abbr and dfn are not in the list. @50Wliu

@50Wliu
Copy link
Contributor

50Wliu commented Nov 6, 2016

The thing is those files are not necessarily used on Github, so maybe we shouldn't confine the snippet list to only elements in the whitelist?

I'm not sure I understand what you mean by this.

@hediyi
Copy link
Contributor Author

hediyi commented Nov 6, 2016

That means "can we add snippets for elements that are not in the sanitation whitelist?"

@50Wliu
Copy link
Contributor

50Wliu commented Nov 6, 2016

But why would we, if GFM doesn't support the others?

@hediyi
Copy link
Contributor Author

hediyi commented Nov 6, 2016

I think it's GitHub that doesn't allow other elements. But not every .md file that is edited in Atom goes to GitHub. There're many other platforms or CMSes also take Markdown files, such as Jekyll and Ghost.

And FWIW, I think that whitelist needs to be improved. As I mentioned, abbr and dfn are often used in online writing, but they're not allowed for some reason, while details, which is more of an interaction element, is allowed.

@50Wliu
Copy link
Contributor

50Wliu commented Nov 7, 2016

Yes, exactly - this is language-gfm, not language-markdown. This package should only be supporting things that GFM supports.

@hediyi
Copy link
Contributor Author

hediyi commented Nov 8, 2016

Yet it's the default grammar package for all .md files, regardless. See my point here?

So if that sanitation list is part of the definition of GFM, you can maybe consider updating that list? As you see it even contains h7, h8, tt, strike. I don't see a reason why abbr, dfn and more can't be in that list.

@50Wliu
Copy link
Contributor

50Wliu commented Nov 8, 2016

The Atom/GitHub team made a conscious decision to make the Markdown language package that's bundled with Atom the GFM variety, and so we need to stick to that.

You would have to ask the maintainers of that list to update it.

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

Successfully merging this pull request may close these issues.

2 participants