Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ const exit = {
directiveContainerLabel: exitContainerLabel,
directiveContainerName: exitName,

directiveContainerAttributeInitializerMarker() {
// If an attribute name follows by `=` it should be treat as string
const attributes = this.getData('directiveAttributes')
attributes[attributes.length - 1][1] = ''
},

directiveLeaf: exitToken,
directiveLeafAttributeClassValue: exitAttributeClassValue,
directiveLeafAttributeIdValue: exitAttributeIdValue,
Expand Down Expand Up @@ -144,7 +150,9 @@ function exitAttributeValue(token: Token) {
function exitAttributeName(token: Token) {
// Attribute names in CommonMark are significantly limited, so character
// references can’t exist.
this.getData('directiveAttributes').push([this.sliceSerialize(token), ''])

// Use `true` as attrubute default value to solve issue of attributes without value (example `:block{attr1 attr2}`)
this.getData('directiveAttributes').push([this.sliceSerialize(token), true])
}

function exitAttributes() {
Expand Down