[css mode] add support for @counter-style#3084
Closed
KwanEsq wants to merge 5 commits intocodemirror:masterfrom
Closed
[css mode] add support for @counter-style#3084KwanEsq wants to merge 5 commits intocodemirror:masterfrom
KwanEsq wants to merge 5 commits intocodemirror:masterfrom
Conversation
Add support for @counter-style blocks by making them and @font-face blocks match a new "restricted_atBlock" state based on "font_face"
Add the values for the @counter-style descriptors 'system' and 'speak-as' to the valueKeywords array [additive, alphabetic, bullets, cyclic, extends, numbers, numeric, spell-out, symbolic, words] fixed (for 'system'), and infinite (for 'range') already present
Add the predefined counter styles from CSS Counter Styles Level 3 that aren't already included [cjk-decimal, disclosure-closed, disclosure-open, ethiopic-numeric, japanese-formal, japanese-informal, korean-hangul-formal, korean-hanja-formal, korean-hanja-informal, simp-chinese-formal, simp-chinese-informal, tamil, trad-chinese-formal, trad-chinese-informal]
4d55d7e to
e0ef414
Compare
e0ef414 to
0c1ad05
Compare
marijnh
added a commit
that referenced
this pull request
Feb 17, 2015
And don't call delete on the state object. Issue #3084
Member
|
Looks good. Merged, and modified slightly in attached patch, with the intent to have a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CSS3 Counter Style spec has reached CR, and Firefox has implemented it. Therefore I'd like to add it to the CSS mode.
My first attempt just naïvely added the descriptors to the keywords, but I didn't like how this meant they were highlighted everywhere. Fortunately I then realised/noticed you'd already implemented @font-face in an isolated way that'd be perfect for @counter-style. Thus this second attempt, which I'm much happier with.
Main issues/questions:
Is the way I'm propagating what type of block it is in, via state.restrictedType, okay? I couldn't see any pre-existing way to access that data, but maybe I just missed it. And should it be named something else? I could see the same approach being useful for distinguishing regular at-blocks in future, should the property be named the same for both?
Is the way I'm handling counter-style names in restricted_atBlock_before correct?