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

Already on GitHub? Sign in to your account

Support for header classes #38

Merged
merged 2 commits into from Jan 5, 2013

Conversation

Projects
None yet
2 participants

I added support for header classes in the Extra with the syntax {.class}, in addition to the id attribute {#id}.

(This is my first attempt at submitting anything on GitHub...sorry if I'm doing it wrong!)

Owner

michelf commented Jul 31, 2012

Your pull request is excellent. But I think if classes get supported, multiple classes should be allowed and they should be all inside the same {curly brackets} together with the id too. So I don't think I'll accept it in the current form.

Good call! I changed some things, and now I think it works fully. Now both id and class attributes for headers are done in the same set of curly braces. All of the following syntaxes work, for both header flavors, as far as I can tell:

  • {#id}
  • {.class1}
  • {#id .class1}
  • {#id .class1 .class2}
  • {#id.class1.class2} (no spaces)

The id attribute does have to come first, but otherwise it's tolerant of any number of spaces before/after. Thanks!

@michelf michelf merged commit 4930b81 into michelf:extra Jan 5, 2013

Owner

michelf commented Jan 6, 2013

This was merged yesterday, but I redid parts of the attribute parser so that you don't necessarily have to put the id attribute first.

Your patch was a great base for the more generalized extra attribute block now used for fenced code blocks too. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment