Closed ldez closed 8 years ago
Complete rewrite of 'block attribute' pattern.
Complete rewrite for 'source', 'quote', 'admonition' patterns.
Delete explicit-paragraph-grammar.cson
and section-grammar.cson
It's the first step to paragraph patterns. The full rewrite with paragraph patterns come in an another PR after this PR will be merged
quotes;
source:
admonition:
@mojavelinux @nicorikken any remarks?
I spotted one comment left in the code changes, addressed with an inline comment (and you fixed while I was typing this message 😄 ) I've tried to break your features (based on the examples here), but failed to do so 😢 , so great work 👍. This level of nesting now introduced seems complicated, but I'm pretty sure I'll get the hang of it when I get into developing mode again. very nice work! 👏
Ready, check, so merge!
This is really unbelievable, @ldez (but I totally believe it). This grammar goes so far beyond any grammar that is out there for AsciiDoc. I actually think this grammar is now going to play an important role in defining a specification for AsciiDoc and, eventually, UniDoc. In fact, I'd even say that together, we might be able to solve the inline parsing problem in Asciidoctor core (wink wink). https://github.com/asciidoctor/asciidoctor/issues/61
I just played around with the new package and discovered a case that may have been missed. I can add an ID to a quote paragraph as follows:
[quote#someone-quote]
This is just a quote from someone.
However, I cannot assign only a role:
[quote.famous]
This is just a quote from someone.
However, I can add a role if I also add an ID:
[quote#someone-quote.famous]
This is just a quote from someone.
The following pattern should be allowed:
[quote#id]
[quote.role]
[quote%option]
[quote.role#id]
[quote#id.role]
[quote%option#id]
[quote.role%option]
etc...
Notice that order doesn't matter. ID can only be specified once, but role and option can be specified any number of times.
To start, we may not have to worry about validating the content adjacent to the block name (e.g., quote) as long as #
, .
and %
are allowed.
Open an issue, I will try to solve this.
this examples already works:
[quote#someone-quote]
This is just a quote from someone.
[quote#someone-quote.famous]
This is just a quote from someone.
Fixed!!
Whole changes of the capture for block attribute . Introducing paragraph patterns.
Support for:
Related to #125 #126