-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Parsing additional info string as meta data on <pre> tags #72
Comments
FWIW The CommonMark spec does not seem to say much about the info string, leaving open the possibility of doing something like this 👍 |
I like 1c, 2b. So parse everything into data iff it is prefixed with
It doesn’t have to be like that, but I like that there’s no additional thinking. You can look at the fence and see that those will just be applied as straight elements delimited by double quotes, quotes, or nothing (which I think is valid? people who write HTML attributes like this are monsters). As for abuse—putting an upper cap of like five or something would be good, I think. I’d rather start low and then go high if needed. I worried that this change would break spec compliance, but according to the spec:
So that’s great news. 🎉 |
This change will likely need to be made in I like 1a, 2b — I'd be worried about letting the users add arbitrary I'd instead be inclined to just drop the entire remainder of the info string into |
@mikekavouras and I have been playing around with a concept of parsing additional information from the
info
string and attaching it as meta data on the<pre>
tags.Input
\```diff something
Output
We want to open up the conversation on two aspects of this feature:
Parsing the meta data
a. Do we parse everything after the info string?
b. Do we parse just the second element after the info string?
c. Do we parse against a predefined pattern. (```ruby [meta])
Exposing the data to the client
a. Do we store the parsed meta in a valid
<pre>
attribute (eg.<pre lang="diff" title="[meta]">
)b. Do we set a
data
attribute on the<pre>
tag (eg.<pre lang="diff" data-meta="[meta]">
)Our Proposal
We vote for
1a
and2b
but we are totally open to any other ideas or suggestions. We figured it would beneficial to provide the client with everything after the info string but we also realize they could be a chance of abusing this implementation. eg.\```ruby jump go never do this
.\cc @kivikakk @gjtorikian
The text was updated successfully, but these errors were encountered: