Skip to content

Commit

Permalink
fix(micromark/summary): fix summary htmlExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahacad committed Jul 13, 2021
1 parent b89ac6b commit 0757a01
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions micromark-extension-details/factory-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import { codes } from 'micromark-util-symbol/codes.js';

export function factorySummary(effects, ok, nok, type) {
const self = this;
console.log(`consume: `);

return start;

function start(code) {
console.log(`code is: ${code}`);
if (is_cn_en(code)) {
effects.enter(type);
effects.enter('chunkString', { contentType: 'string' });
effects.consume(code);
return summary;
}
Expand All @@ -24,11 +23,10 @@ export function factorySummary(effects, ok, nok, type) {
is_cn_en(code)
) {
effects.consume(code);
console.log(`consume: ${code}`);
return summary;
}

console.log('OK');
effects.exit('chunkString');
effects.exit(type);
return ok(code);
}
Expand Down
1 change: 1 addition & 0 deletions micromark-extension-details/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function detailsHtml(options = {}) {
},
detailsContainerSummary() {
const data = this.resume();
this.raw(data);
this.tag('</summary>');
},
detailsExpanded() {
Expand Down
2 changes: 1 addition & 1 deletion tests/test-micromark.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '../micromark-extension-details/index.js';

test('first', (t) => {
const value = `???+arnsono asrineta\ns`;
const value = `???+总结如下\ns`;
const a = micromark(value, {
extensions: [syntax()],
htmlExtensions: [html()],
Expand Down

0 comments on commit 0757a01

Please sign in to comment.