Skip to content

Commit

Permalink
fix(micromark): fix factoryDetailsClass output in micromark
Browse files Browse the repository at this point in the history
using sliceSerialize(token) now rather than chunkString
  • Loading branch information
Ahacad committed Jul 15, 2021
1 parent f2417f1 commit d11434d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions micromark-extension-details/factory-details-class.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { markdownLineEnding, markdownSpace } from 'micromark-util-character';
import { codes } from 'micromark-util-symbol/codes.js';
import { constants } from 'micromark-util-symbol/constants.js';
import { types } from 'micromark-util-symbol/types.js';

export function factoryDetailsClass(effects, ok, nok) {
const self = this;
Expand All @@ -22,13 +24,11 @@ export function factoryDetailsClass(effects, ok, nok) {
return nok(code);
}
effects.enter('detailsContainerClassName');
effects.enter('chunkString', { contentType: 'string' });
return className;
}
function className(code) {
if (num === detailsClass.length) {
if (markdownSpace(code)) {
effects.exit('chunkString');
effects.exit('detailsContainerClassName');
return ok(code);
} else {
Expand Down
6 changes: 2 additions & 4 deletions micromark-extension-details/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export function detailsHtml(options = {}) {
},
detailsContainerClassName() {
this.tag(` class="`);
this.buffer();
},
detailsContainerSummary() {
this.tag('>');
Expand All @@ -21,9 +20,8 @@ export function detailsHtml(options = {}) {
detailsContainer() {
this.tag('</details>');
},
detailsContainerClassName() {
const data = this.resume();
this.tag(data);
detailsContainerClassName(token) {
this.tag(this.sliceSerialize(token));
this.tag(`"`);
},
detailsContainerSummary() {
Expand Down

0 comments on commit d11434d

Please sign in to comment.