Skip to content

Commit

Permalink
Allow reusing InlineWrapDirective for other element types (#186)
Browse files Browse the repository at this point in the history
* Allow reusing InlineWrapDirective for other element types

For example you could add an `InlineWrapDirective("aside")` to allow
`@aside[text] { .blue }` leading to `<aside class="blue">text</aside>".

* Also allow the uppercase variant

And avoid types getting confused somehow
  • Loading branch information
raboof authored Feb 13, 2018
1 parent 6dc6f4c commit 2946d1d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ case class WrapDirective(typ: String) extends ContainerBlockDirective(Array(typ,
*
* Wraps inner contents in a `span`, optionally with custom `id` and/or `class` attributes.
*/
case class InlineWrapDirective(typ: String) extends InlineDirective("span") {
case class InlineWrapDirective(typ: String) extends InlineDirective(Array(typ, typ.toUpperCase): _*) {

def render(node: DirectiveNode, visitor: Visitor, printer: Printer): Unit = {
val id =
node.attributes.identifier match {
Expand Down

0 comments on commit 2946d1d

Please sign in to comment.